diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2017-02-11 15:43:09 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-02-11 15:43:09 +0100 |
commit | e6408b2e7ade3dac8dcf14bcda5b5c6a159fa74c (patch) | |
tree | 7ba827f801bea1556231d275a6a8a35471f8a954 /app/helpers/atom_builder_helper.rb | |
parent | 0afed995ce60dec11bc7718f83ca5afde86f6228 (diff) | |
parent | 446aad4ce2cb7afd0ba8e4b508e4dcba57eac790 (diff) |
Merge branch 'feature-privacy-federation' into development
Diffstat (limited to 'app/helpers/atom_builder_helper.rb')
-rw-r--r-- | app/helpers/atom_builder_helper.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/helpers/atom_builder_helper.rb b/app/helpers/atom_builder_helper.rb index fb8f0976c..5d20f8c2d 100644 --- a/app/helpers/atom_builder_helper.rb +++ b/app/helpers/atom_builder_helper.rb @@ -143,6 +143,10 @@ module AtomBuilderHelper xml.link(:rel => 'mentioned', :href => TagManager::COLLECTIONS[:public], 'ostatus:object-type' => TagManager::TYPES[:collection]) end + def privacy_scope(xml, level) + xml['mastodon'].scope(level) + end + def include_author(xml, account) object_type xml, :person uri xml, TagManager.instance.uri_for(account) @@ -152,6 +156,7 @@ module AtomBuilderHelper link_alternate xml, TagManager.instance.url_for(account) link_avatar xml, account portable_contact xml, account + privacy_scope xml, account.locked? ? :private : :public end def rich_content(xml, activity) @@ -216,6 +221,7 @@ module AtomBuilderHelper end category(xml, 'nsfw') if stream_entry.target.sensitive? + privacy_scope(xml, stream_entry.target.visibility) end end end @@ -237,6 +243,7 @@ module AtomBuilderHelper end category(xml, 'nsfw') if stream_entry.activity.sensitive? + privacy_scope(xml, stream_entry.activity.visibility) end private @@ -249,6 +256,7 @@ module AtomBuilderHelper 'xmlns:poco' => TagManager::POCO_XMLNS, 'xmlns:media' => TagManager::MEDIA_XMLNS, 'xmlns:ostatus' => TagManager::OS_XMLNS, + 'xmlns:mastodon' => TagManager::MTDN_XMLNS, }, &block) end |