From 6208ea5a531e8ece85ec29dd42dbc051e34a29e4 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 7 May 2018 14:49:13 +0200 Subject: If an OStatus message contains nsfw hashtag, mark it as sensitive (#7398) * If an OStatus message contains nsfw hashtag, mark it as sensitive Undo parts of #7048 * Put nsfw hashtag on OStatus messages if they have any media * Fix code style issues --- app/lib/ostatus/atom_serializer.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'app/lib/ostatus/atom_serializer.rb') diff --git a/app/lib/ostatus/atom_serializer.rb b/app/lib/ostatus/atom_serializer.rb index 7c66f2066..698f2ee22 100644 --- a/app/lib/ostatus/atom_serializer.rb +++ b/app/lib/ostatus/atom_serializer.rb @@ -368,6 +368,7 @@ class OStatus::AtomSerializer append_element(entry, 'link', nil, rel: :enclosure, type: media.file_content_type, length: media.file_file_size, href: full_asset_url(media.file.url(:original, false))) end + append_element(entry, 'category', nil, term: 'nsfw') if status.sensitive? && status.media_attachments.any? append_element(entry, 'mastodon:scope', status.visibility) status.emojis.each do |emoji| -- cgit