Merge branch 'fix/hashtags-streaming' into 'develop'
authorrinpatch <rinpatch@sdf.org>
Fri, 13 Mar 2020 18:50:17 +0000 (18:50 +0000)
committerrinpatch <rinpatch@sdf.org>
Fri, 13 Mar 2020 18:50:17 +0000 (18:50 +0000)
Fix hashtags WebSocket streaming

Closes #1593

See merge request pleroma/pleroma!2294

lib/pleroma/activity/ir/topics.ex
test/activity/ir/topics_test.exs

index 4acc1a3e004eb744b59e73e7cc6c642d6d51e401..9e65bedade120e9daecc35fa4bfc132fdabc2fbb 100644 (file)
@@ -39,7 +39,7 @@ defmodule Pleroma.Activity.Ir.Topics do
     end
   end
 
-  defp item_creation_tags(tags, %{data: %{"type" => "Create"}} = object, activity) do
+  defp item_creation_tags(tags, object, %{data: %{"type" => "Create"}} = activity) do
     tags ++ hashtags_to_topics(object) ++ attachment_topics(object, activity)
   end
 
index e75f83586a5e585426d9ed7c4a5379f4e81074a9..44aec1e199ddaa6875ac3f9352824deb678c2a28 100644 (file)
@@ -59,8 +59,8 @@ defmodule Pleroma.Activity.Ir.TopicsTest do
   describe "public visibility create events" do
     setup do
       activity = %Activity{
-        object: %Object{data: %{"type" => "Create", "attachment" => []}},
-        data: %{"to" => [Pleroma.Constants.as_public()]}
+        object: %Object{data: %{"attachment" => []}},
+        data: %{"type" => "Create", "to" => [Pleroma.Constants.as_public()]}
       }
 
       {:ok, activity: activity}
@@ -98,8 +98,8 @@ defmodule Pleroma.Activity.Ir.TopicsTest do
   describe "public visibility create events with attachments" do
     setup do
       activity = %Activity{
-        object: %Object{data: %{"type" => "Create", "attachment" => ["foo"]}},
-        data: %{"to" => [Pleroma.Constants.as_public()]}
+        object: %Object{data: %{"attachment" => ["foo"]}},
+        data: %{"type" => "Create", "to" => [Pleroma.Constants.as_public()]}
       }
 
       {:ok, activity: activity}