X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Fwebsub%2Fwebsub.ex;h=3ffa6b416b4391bc3d16325c8ed3e2ea37f365f5;hb=b92a16aa006dd7ec26397b6fcd111c8f8f843a9c;hp=a08d7993d007915d63a00265ab4389ab2e825a37;hpb=06c4935c11fc58f5ede18706bc46dcc502e64052;p=akkoma diff --git a/lib/pleroma/web/websub/websub.ex b/lib/pleroma/web/websub/websub.ex index a08d7993d..3ffa6b416 100644 --- a/lib/pleroma/web/websub/websub.ex +++ b/lib/pleroma/web/websub/websub.ex @@ -6,13 +6,14 @@ defmodule Pleroma.Web.Websub do alias Ecto.Changeset alias Pleroma.Instances alias Pleroma.Repo - alias Pleroma.Web.Websub.WebsubServerSubscription - alias Pleroma.Web.Websub.WebsubClientSubscription - alias Pleroma.Web.OStatus.FeedRepresenter - alias Pleroma.Web.XML alias Pleroma.Web.Endpoint + alias Pleroma.Web.Federator alias Pleroma.Web.OStatus + alias Pleroma.Web.OStatus.FeedRepresenter alias Pleroma.Web.Router.Helpers + alias Pleroma.Web.Websub.WebsubClientSubscription + alias Pleroma.Web.Websub.WebsubServerSubscription + alias Pleroma.Web.XML require Logger import Ecto.Query @@ -87,7 +88,7 @@ defmodule Pleroma.Web.Websub do unreachable_since: reachable_callbacks_metadata[sub.callback] } - Pleroma.Web.Federator.enqueue(:publish_single_websub, data) + Federator.publish_single_websub(data) end) end @@ -119,7 +120,7 @@ defmodule Pleroma.Web.Websub do websub = Repo.update!(change) - Pleroma.Web.Federator.enqueue(:verify_websub, websub) + Federator.verify_websub(websub) {:ok, websub} else @@ -199,8 +200,8 @@ defmodule Pleroma.Web.Websub do uri when not is_nil(uri) <- XML.string_from_xpath("/feed/author[1]/uri", doc), hub when not is_nil(hub) <- XML.string_from_xpath(~S{/feed/link[@rel="hub"]/@href}, doc) do name = XML.string_from_xpath("/feed/author[1]/name", doc) - preferredUsername = XML.string_from_xpath("/feed/author[1]/poco:preferredUsername", doc) - displayName = XML.string_from_xpath("/feed/author[1]/poco:displayName", doc) + preferred_username = XML.string_from_xpath("/feed/author[1]/poco:preferredUsername", doc) + display_name = XML.string_from_xpath("/feed/author[1]/poco:displayName", doc) avatar = OStatus.make_avatar_object(doc) bio = XML.string_from_xpath("/feed/author[1]/summary", doc) @@ -208,8 +209,8 @@ defmodule Pleroma.Web.Websub do %{ "uri" => uri, "hub" => hub, - "nickname" => preferredUsername || name, - "name" => displayName || name, + "nickname" => preferred_username || name, + "name" => display_name || name, "host" => URI.parse(uri).host, "avatar" => avatar, "bio" => bio @@ -269,7 +270,7 @@ defmodule Pleroma.Web.Websub do subs = Repo.all(query) Enum.each(subs, fn sub -> - Pleroma.Web.Federator.enqueue(:request_subscription, sub) + Federator.request_subscription(sub) end) end