From b4f055b60416986220d905bbf688f8417cd8a270 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Thu, 5 Oct 2017 12:53:16 +0200 Subject: [PATCH] Don't reject already accepted subscriptions. --- lib/pleroma/web/websub/websub.ex | 6 +++--- test/web/websub/websub_test.exs | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) 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 -- 2.45.2