Revert "Merge branch 'features/hashtag-column' into 'develop'"
This reverts merge request !2824
This commit is contained in:
parent
b122b6ffa3
commit
3966add048
24 changed files with 70 additions and 163 deletions
|
|
@ -78,7 +78,7 @@ defmodule Pleroma.Activity.Ir.TopicsTest do
|
|||
end
|
||||
|
||||
test "converts tags to hash tags", %{activity: %{object: %{data: data} = object} = activity} do
|
||||
tagged_data = Map.put(data, "hashtags", ["foo", "bar"])
|
||||
tagged_data = Map.put(data, "tag", ["foo", "bar"])
|
||||
activity = %{activity | object: %{object | data: tagged_data}}
|
||||
|
||||
topics = Topics.get_activity_topics(activity)
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.SimplePolicyTest do
|
|||
assert SimplePolicy.filter(media_message) ==
|
||||
{:ok,
|
||||
media_message
|
||||
|> put_in(["object", "hashtags"], ["foo", "nsfw"])
|
||||
|> put_in(["object", "tag"], ["foo", "nsfw"])
|
||||
|> put_in(["object", "sensitive"], true)}
|
||||
|
||||
assert SimplePolicy.filter(local_message) == {:ok, local_message}
|
||||
|
|
@ -92,7 +92,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.SimplePolicyTest do
|
|||
assert SimplePolicy.filter(media_message) ==
|
||||
{:ok,
|
||||
media_message
|
||||
|> put_in(["object", "hashtags"], ["foo", "nsfw"])
|
||||
|> put_in(["object", "tag"], ["foo", "nsfw"])
|
||||
|> put_in(["object", "sensitive"], true)}
|
||||
|
||||
assert SimplePolicy.filter(local_message) == {:ok, local_message}
|
||||
|
|
@ -105,7 +105,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.SimplePolicyTest do
|
|||
"type" => "Create",
|
||||
"object" => %{
|
||||
"attachment" => [%{}],
|
||||
"hashtags" => ["foo"],
|
||||
"tag" => ["foo"],
|
||||
"sensitive" => false
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.NoteHandlingTest do
|
|||
{:ok, %Activity{data: data, local: false}} = Transmogrifier.handle_incoming(data)
|
||||
object = Object.normalize(data["object"])
|
||||
|
||||
assert ["test"] == object.data["hashtags"]
|
||||
assert "test" in object.data["tag"]
|
||||
end
|
||||
|
||||
test "it cleans up incoming notices which are not really DMs" do
|
||||
|
|
@ -220,7 +220,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.NoteHandlingTest do
|
|||
{:ok, %Activity{data: data, local: false}} = Transmogrifier.handle_incoming(data)
|
||||
object = Object.normalize(data["object"])
|
||||
|
||||
assert object.data["hashtags"] == ["moo"]
|
||||
assert Enum.at(object.data["tag"], 2) == "moo"
|
||||
end
|
||||
|
||||
test "it works for incoming notices with contentMap" do
|
||||
|
|
|
|||
|
|
@ -204,37 +204,30 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
|
|||
|
||||
{:ok, activity} = CommonAPI.post(user, %{status: "#2hu :firefox:"})
|
||||
|
||||
{:ok, %{"object" => modified_object}} = Transmogrifier.prepare_outgoing(activity.data)
|
||||
{:ok, modified} = Transmogrifier.prepare_outgoing(activity.data)
|
||||
|
||||
assert [
|
||||
%{"name" => "#2hu", "type" => "Hashtag"},
|
||||
%{"name" => ":firefox:", "type" => "Emoji"}
|
||||
] = modified_object["tag"]
|
||||
assert length(modified["object"]["tag"]) == 2
|
||||
|
||||
refute Map.has_key?(modified_object, "hashtags")
|
||||
refute Map.has_key?(modified_object, "emoji")
|
||||
refute Map.has_key?(modified_object, "like_count")
|
||||
refute Map.has_key?(modified_object, "announcements")
|
||||
refute Map.has_key?(modified_object, "announcement_count")
|
||||
refute Map.has_key?(modified_object, "context_id")
|
||||
assert is_nil(modified["object"]["emoji"])
|
||||
assert is_nil(modified["object"]["like_count"])
|
||||
assert is_nil(modified["object"]["announcements"])
|
||||
assert is_nil(modified["object"]["announcement_count"])
|
||||
assert is_nil(modified["object"]["context_id"])
|
||||
end
|
||||
|
||||
test "it strips internal fields of article" do
|
||||
activity = insert(:article_activity)
|
||||
|
||||
{:ok, %{"object" => modified_object}} = Transmogrifier.prepare_outgoing(activity.data)
|
||||
{:ok, modified} = Transmogrifier.prepare_outgoing(activity.data)
|
||||
|
||||
assert [
|
||||
%{"name" => "#2hu", "type" => "Hashtag"},
|
||||
%{"name" => ":2hu:", "type" => "Emoji"}
|
||||
] = modified_object["tag"]
|
||||
assert length(modified["object"]["tag"]) == 2
|
||||
|
||||
refute Map.has_key?(modified_object, "hashtags")
|
||||
refute Map.has_key?(modified_object, "emoji")
|
||||
refute Map.has_key?(modified_object, "like_count")
|
||||
refute Map.has_key?(modified_object, "announcements")
|
||||
refute Map.has_key?(modified_object, "announcement_count")
|
||||
refute Map.has_key?(modified_object, "context_id")
|
||||
assert is_nil(modified["object"]["emoji"])
|
||||
assert is_nil(modified["object"]["like_count"])
|
||||
assert is_nil(modified["object"]["announcements"])
|
||||
assert is_nil(modified["object"]["announcement_count"])
|
||||
assert is_nil(modified["object"]["context_id"])
|
||||
assert is_nil(modified["object"]["likes"])
|
||||
end
|
||||
|
||||
test "the directMessage flag is present" do
|
||||
|
|
|
|||
|
|
@ -591,8 +591,7 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do
|
|||
"context" => "2hu",
|
||||
"sensitive" => false,
|
||||
"summary" => "test summary",
|
||||
"hashtags" => ["jimm"],
|
||||
"tag" => [],
|
||||
"tag" => ["jimm"],
|
||||
"to" => [user2.ap_id],
|
||||
"type" => "Note",
|
||||
"custom_tag" => "test"
|
||||
|
|
|
|||
|
|
@ -493,8 +493,7 @@ defmodule Pleroma.Web.CommonAPITest do
|
|||
|
||||
object = Object.normalize(activity)
|
||||
|
||||
assert object.data["tag"] == []
|
||||
assert object.data["hashtags"] == ["2hu"]
|
||||
assert object.data["tag"] == ["2hu"]
|
||||
end
|
||||
|
||||
test "it adds emoji in the object" do
|
||||
|
|
|
|||
|
|
@ -262,8 +262,8 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
|
|||
mentions: [],
|
||||
tags: [
|
||||
%{
|
||||
name: "2hu",
|
||||
url: "/tag/2hu"
|
||||
name: "#{object_data["tag"]}",
|
||||
url: "/tag/#{object_data["tag"]}"
|
||||
}
|
||||
],
|
||||
application: %{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue