diff options
author | Roger Braun <roger@rogerbraun.net> | 2017-05-11 09:13:14 +0200 |
---|---|---|
committer | Roger Braun <roger@rogerbraun.net> | 2017-05-11 09:13:14 +0200 |
commit | 312772df7c7495b58724ad380e870dd4e2acf2d2 (patch) | |
tree | 6c654bd6c17d5bb07f913b32293cf5d69880bfb6 | |
parent | 1b67a597955b87ff792d50bed913b0af59f14edc (diff) | |
download | pleroma-312772df7c7495b58724ad380e870dd4e2acf2d2.tar.gz pleroma-312772df7c7495b58724ad380e870dd4e2acf2d2.zip |
Add debugging help.
-rw-r--r-- | lib/pleroma/web/ostatus/ostatus.ex | 5 | ||||
-rw-r--r-- | lib/pleroma/web/websub/websub.ex | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/pleroma/web/ostatus/ostatus.ex b/lib/pleroma/web/ostatus/ostatus.ex index 4fb647a39..9cd440493 100644 --- a/lib/pleroma/web/ostatus/ostatus.ex +++ b/lib/pleroma/web/ostatus/ostatus.ex @@ -140,6 +140,8 @@ defmodule Pleroma.Web.OStatus do inReplyToHref = string_from_xpath("//thr:in-reply-to[1]/@href", entry) if inReplyToHref do fetch_activity_from_html_url(inReplyToHref) + else + Logger.debug("Couldn't find a href link to #{inReplyTo}") end end @@ -288,10 +290,13 @@ defmodule Pleroma.Web.OStatus do end def fetch_activity_from_html_url(url) do + Logger.debug("Trying to fetch #{url}") with {:ok, %{body: body}} <- @httpoison.get(url, [], follow_redirect: true), {:ok, atom_url} <- get_atom_url(body), {:ok, %{status_code: code, body: body}} when code in 200..299 <- @httpoison.get(atom_url, [], follow_redirect: true) do + Logger.debug("Got #{url}, handling...") handle_incoming(body) + else e -> Logger.debug("Couldn't get #{url}: #{inspect(e)}") end end end diff --git a/lib/pleroma/web/websub/websub.ex b/lib/pleroma/web/websub/websub.ex index 2276ddeec..e46e0a2ce 100644 --- a/lib/pleroma/web/websub/websub.ex +++ b/lib/pleroma/web/websub/websub.ex @@ -39,6 +39,7 @@ defmodule Pleroma.Web.Websub do end def publish(topic, user, activity) do + # TODO: Only send to still valid subscriptions. query = from sub in WebsubServerSubscription, where: sub.topic == ^topic and sub.state == "active" subscriptions = Repo.all(query) |