Handle sensitive property.
[akkoma] / lib / pleroma / web / twitter_api / representers / activity_representer.ex
index 1f11bc9ac5ba09a7f027b327ee49ef1f5d712544..f9f9bd7b4bee118988f08da10231219e330ef2b0 100644 (file)
@@ -133,7 +133,9 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
     conversation_id = conversation_id(activity)
 
     tags = activity.data["object"]["tag"] || []
-    possibly_sensitive = Enum.member?(tags, "nsfw")
+    possibly_sensitive = activity.data["object"]["sensitive"] || Enum.member?(tags, "nsfw")
+
+    tags = if possibly_sensitive, do: ["nsfw" | tags], else: tags
 
     summary = activity.data["object"]["summary"]
     content = if !!summary and summary != "" do