Don't reject already accepted subscriptions.
authorRoger Braun <roger@rogerbraun.net>
Thu, 5 Oct 2017 10:53:16 +0000 (12:53 +0200)
committerRoger Braun <roger@rogerbraun.net>
Thu, 5 Oct 2017 10:53:16 +0000 (12:53 +0200)
lib/pleroma/web/websub/websub.ex
test/web/websub/websub_test.exs

index 6bbf13130dfb79e91fcdcfa0697620334798bf0a..db1577a9373a71044263266a0b9443254dad2d94 100644 (file)
@@ -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
index 1ca573d6600bf49b00eda84deadad111fc3be6b3..6b2c612addcc93c74f7b809ab92aa17b6113114a 100644 (file)
@@ -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