aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRoger Braun <roger@rogerbraun.net>2017-08-24 16:27:37 +0200
committerRoger Braun <roger@rogerbraun.net>2017-08-24 16:27:37 +0200
commit67bfa19b35af6ae4a064b02f3888dd11a218f6fb (patch)
tree061c3f6571ed3b554f4b5da50ab73e970c7739f1 /lib
parent5dc278b1a68a244ad09853ef3e9a100851a51420 (diff)
downloadpleroma-67bfa19b35af6ae4a064b02f3888dd11a218f6fb.tar.gz
Set twitter-style possibly_sensitive boolena.
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/twitter_api/representers/activity_representer.ex8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/pleroma/web/twitter_api/representers/activity_representer.ex b/lib/pleroma/web/twitter_api/representers/activity_representer.ex
index 16a2f6810..bc3de0e90 100644
--- a/lib/pleroma/web/twitter_api/representers/activity_representer.ex
+++ b/lib/pleroma/web/twitter_api/representers/activity_representer.ex
@@ -112,6 +112,9 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
conversation_id = conversation_id(activity)
+ tags = activity.data["object"]["tag"] || []
+ possibly_sensitive = Enum.member?(tags, "nsfw")
+
%{
"id" => activity.id,
"user" => UserView.render("show.json", %{user: user, for: opts[:for]}),
@@ -129,8 +132,9 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
"favorited" => to_boolean(favorited),
"repeated" => to_boolean(repeated),
"external_url" => object["external_url"],
- "tags" => activity.data["object"]["tag"] || [],
- "activity_type" => "post"
+ "tags" => tags,
+ "activity_type" => "post",
+ "possibly_sensitive" => possibly_sensitive
}
end