diff options
author | ThibG <thib@sitedethib.com> | 2020-11-07 21:47:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-07 21:47:31 +0100 |
commit | cfb16b9b70a50ec5451c9aebb2c35d3a44701311 (patch) | |
tree | 6ba298899b376d0c8862d77c1e34339a08dc3121 /app/serializers | |
parent | 5a9fc749c3eab8d3c93dd282fa89c20a5cb0e994 (diff) | |
parent | e4d62042bdb3b0d675c2367b4c48a2a48647af5e (diff) |
Merge pull request #1453 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/serializers')
-rw-r--r-- | app/serializers/activitypub/note_serializer.rb | 4 | ||||
-rw-r--r-- | app/serializers/rest/status_serializer.rb | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/app/serializers/activitypub/note_serializer.rb b/app/serializers/activitypub/note_serializer.rb index a0965790e..4ac699ddf 100644 --- a/app/serializers/activitypub/note_serializer.rb +++ b/app/serializers/activitypub/note_serializer.rb @@ -110,6 +110,10 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer ActivityPub::TagManager.instance.cc(object) end + def sensitive + object.account.sensitized? || object.sensitive + end + def virtual_tags object.active_mentions.to_a.sort_by(&:id) + object.tags + object.emojis end diff --git a/app/serializers/rest/status_serializer.rb b/app/serializers/rest/status_serializer.rb index 58e7bd4e4..b5dcf6208 100644 --- a/app/serializers/rest/status_serializer.rb +++ b/app/serializers/rest/status_serializer.rb @@ -60,6 +60,14 @@ class REST::StatusSerializer < ActiveModel::Serializer end end + def sensitive + if current_user? && current_user.account_id == object.account_id + object.sensitive + else + object.account.sensitized? || object.sensitive + end + end + def uri ActivityPub::TagManager.instance.uri_for(object) end |