Fix hashtags WebSocket streaming
authorEgor Kislitsyn <egor@kislitsyn.com>
Fri, 13 Mar 2020 15:30:42 +0000 (19:30 +0400)
committerrinpatch <rinpatch@sdf.org>
Sun, 15 Mar 2020 14:00:18 +0000 (17:00 +0300)
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}