Only handle subscription requests for now.
authorRoger Braun <roger@rogerbraun.net>
Sat, 22 Apr 2017 11:48:10 +0000 (13:48 +0200)
committerRoger Braun <roger@rogerbraun.net>
Sat, 22 Apr 2017 11:48:10 +0000 (13:48 +0200)
lib/pleroma/web/websub/websub.ex
test/web/websub/websub_controller_test.exs
test/web/websub/websub_test.exs

index 50878e3c4ca4a9d2762c4fec0ccd42ab3323adce..cf819afd14deb2e6f1a464efaa96ed9115e49c61 100644 (file)
@@ -52,7 +52,7 @@ defmodule Pleroma.Web.Websub do
     end)
   end
 
-  def incoming_subscription_request(user, params) do
+  def incoming_subscription_request(user, %{"hub.mode" => "subscribe"} = params) do
     with {:ok, topic} <- valid_topic(params, user),
          {:ok, lease_time} <- lease_time(params),
          secret <- params["hub.secret"],
index 9a0a5c61bea282e9d6f6a3f729436f1f4411717e..8368cafea584ec76f1a49abba439d475253158f1 100644 (file)
@@ -9,7 +9,7 @@ defmodule Pleroma.Web.Websub.WebsubControllerTest do
 
     data = %{
       "hub.callback": "http://example.org/sub",
-      "hub.mode": "subscription",
+      "hub.mode": "subscribe",
       "hub.topic": Pleroma.Web.OStatus.feed_path(user),
       "hub.secret": "a random secret",
       "hub.lease_seconds": "100"
index 5fe91d0f86950107ec169f61fb1e9fa8c1be543b..334ba03fc28bea529635d8758b07ef7921323e2b 100644 (file)
@@ -52,7 +52,7 @@ defmodule Pleroma.Web.WebsubTest do
 
     data = %{
       "hub.callback" => "http://example.org/sub",
-      "hub.mode" => "subscription",
+      "hub.mode" => "subscribe",
       "hub.topic" => Pleroma.Web.OStatus.feed_path(user),
       "hub.secret" => "a random secret",
       "hub.lease_seconds" => "100"
@@ -72,7 +72,7 @@ defmodule Pleroma.Web.WebsubTest do
 
     data = %{
       "hub.callback" => sub.callback,
-      "hub.mode" => "subscription",
+      "hub.mode" => "subscribe",
       "hub.topic" => Pleroma.Web.OStatus.feed_path(user),
       "hub.secret" => "a random secret",
       "hub.lease_seconds" => "100"