From: Roger Braun Date: Thu, 5 Oct 2017 10:53:16 +0000 (+0200) Subject: Don't reject already accepted subscriptions. X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=b4f055b60416986220d905bbf688f8417cd8a270;p=akkoma Don't reject already accepted subscriptions. --- diff --git a/lib/pleroma/web/websub/websub.ex b/lib/pleroma/web/websub/websub.ex index 6bbf13130..db1577a93 100644 --- a/lib/pleroma/web/websub/websub.ex +++ b/lib/pleroma/web/websub/websub.ex @@ -31,9 +31,9 @@ defmodule Pleroma.Web.Websub do do changeset = Changeset.change(subscription, %{state: "active"}) Repo.update(changeset) - else _e -> - changeset = Changeset.change(subscription, %{state: "rejected"}) - {:ok, subscription} = Repo.update(changeset) + else e -> + Logger.debug("Couldn't verify subscription") + Logger.debug(inspect(e)) {:error, subscription} end end diff --git a/test/web/websub/websub_test.exs b/test/web/websub/websub_test.exs index 1ca573d66..6b2c612ad 100644 --- a/test/web/websub/websub_test.exs +++ b/test/web/websub/websub_test.exs @@ -46,7 +46,8 @@ defmodule Pleroma.Web.WebsubTest do end {:error, sub} = Websub.verify(sub, getter) - assert sub.state == "rejected" + # Keep the current state. + assert sub.state == "requested" end test "an incoming subscription request" do