diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2017-02-13 13:30:33 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-02-13 13:30:33 +0100 |
commit | 8e08ae5bb91868d727fdd877aba0133744ad9934 (patch) | |
tree | eff2e42508f098ba524167b21b4a561fad070066 | |
parent | df63461ff091f6b513c797d010f82dee73f437b2 (diff) |
Add IDs to salmon slaps even if they are transient. Add title, too, mostly
in case of debugging incoming salmons. Add <thr:in-reply-to /> to favourite salmons because it seems to be required by GS.
-rw-r--r-- | app/services/authorize_follow_service.rb | 3 | ||||
-rw-r--r-- | app/services/block_service.rb | 1 | ||||
-rw-r--r-- | app/services/favourite_service.rb | 2 | ||||
-rw-r--r-- | app/services/follow_service.rb | 2 | ||||
-rw-r--r-- | app/services/reject_follow_service.rb | 3 | ||||
-rw-r--r-- | app/services/unblock_service.rb | 1 | ||||
-rw-r--r-- | app/services/unfavourite_service.rb | 2 | ||||
-rw-r--r-- | app/services/unfollow_service.rb | 1 |
8 files changed, 15 insertions, 0 deletions
diff --git a/app/services/authorize_follow_service.rb b/app/services/authorize_follow_service.rb index 2e0b6d26c..ac465bdb2 100644 --- a/app/services/authorize_follow_service.rb +++ b/app/services/authorize_follow_service.rb @@ -12,6 +12,9 @@ class AuthorizeFollowService < BaseService def build_xml(follow_request) Nokogiri::XML::Builder.new do |xml| entry(xml, true) do + unique_id xml, Time.now.utc, follow_request.id, 'FollowRequest' + title xml, "#{follow_request.target_account.acct} authorizes follow request by #{follow_request.account.acct}" + author(xml) do include_author xml, follow_request.target_account end diff --git a/app/services/block_service.rb b/app/services/block_service.rb index bcd8c44c4..bd914d8be 100644 --- a/app/services/block_service.rb +++ b/app/services/block_service.rb @@ -20,6 +20,7 @@ class BlockService < BaseService def build_xml(block) Nokogiri::XML::Builder.new do |xml| entry(xml, true) do + unique_id xml, block.created_at, block.id, 'Block' title xml, "#{block.account.acct} no longer wishes to interact with #{block.target_account.acct}" author(xml) do diff --git a/app/services/favourite_service.rb b/app/services/favourite_service.rb index 7038bc222..824729ed6 100644 --- a/app/services/favourite_service.rb +++ b/app/services/favourite_service.rb @@ -24,6 +24,7 @@ class FavouriteService < BaseService def build_xml(favourite) Nokogiri::XML::Builder.new do |xml| entry(xml, true) do + unique_id xml, favourite.created_at, favourite.id, 'Favourite' title xml, "#{favourite.account.acct} favourited a status by #{favourite.status.account.acct}" author(xml) do @@ -32,6 +33,7 @@ class FavouriteService < BaseService object_type xml, :activity verb xml, :favorite + in_reply_to xml, TagManager.instance.uri_for(favourite.status), TagManager.instance.url_for(favourite.status) target(xml) do include_target xml, favourite.status diff --git a/app/services/follow_service.rb b/app/services/follow_service.rb index 5a4250636..d67b1bf2d 100644 --- a/app/services/follow_service.rb +++ b/app/services/follow_service.rb @@ -57,6 +57,7 @@ class FollowService < BaseService def build_follow_request_xml(follow_request) Nokogiri::XML::Builder.new do |xml| entry(xml, true) do + unique_id xml, follow_request.created_at, follow_request.id, 'FollowRequest' title xml, "#{follow_request.account.acct} requested to follow #{follow_request.target_account.acct}" author(xml) do @@ -76,6 +77,7 @@ class FollowService < BaseService def build_follow_xml(follow) Nokogiri::XML::Builder.new do |xml| entry(xml, true) do + unique_id xml, follow.created_at, follow.id, 'Follow' title xml, "#{follow.account.acct} started following #{follow.target_account.acct}" author(xml) do diff --git a/app/services/reject_follow_service.rb b/app/services/reject_follow_service.rb index ac92ad5f7..1b03d62e6 100644 --- a/app/services/reject_follow_service.rb +++ b/app/services/reject_follow_service.rb @@ -12,6 +12,9 @@ class RejectFollowService < BaseService def build_xml(follow_request) Nokogiri::XML::Builder.new do |xml| entry(xml, true) do + unique_id xml, Time.now.utc, follow_request.id, 'FollowRequest' + title xml, "#{follow_request.target_account.acct} rejects follow request by #{follow_request.account.acct}" + author(xml) do include_author xml, follow_request.target_account end diff --git a/app/services/unblock_service.rb b/app/services/unblock_service.rb index 4ff180747..c4f789f74 100644 --- a/app/services/unblock_service.rb +++ b/app/services/unblock_service.rb @@ -13,6 +13,7 @@ class UnblockService < BaseService def build_xml(block) Nokogiri::XML::Builder.new do |xml| entry(xml, true) do + unique_id xml, Time.now.utc, block.id, 'Block' title xml, "#{block.account.acct} no longer blocks #{block.target_account.acct}" author(xml) do diff --git a/app/services/unfavourite_service.rb b/app/services/unfavourite_service.rb index 7ad1778f6..1d3e6f06d 100644 --- a/app/services/unfavourite_service.rb +++ b/app/services/unfavourite_service.rb @@ -15,6 +15,7 @@ class UnfavouriteService < BaseService def build_xml(favourite) Nokogiri::XML::Builder.new do |xml| entry(xml, true) do + unique_id xml, Time.now.utc, favourite.id, 'Favourite' title xml, "#{favourite.account.acct} no longer favourites a status by #{favourite.status.account.acct}" author(xml) do @@ -23,6 +24,7 @@ class UnfavouriteService < BaseService object_type xml, :activity verb xml, :unfavorite + in_reply_to xml, TagManager.instance.uri_for(favourite.status), TagManager.instance.url_for(favourite.status) target(xml) do include_target xml, favourite.status diff --git a/app/services/unfollow_service.rb b/app/services/unfollow_service.rb index 8982b1c19..07f9b93dd 100644 --- a/app/services/unfollow_service.rb +++ b/app/services/unfollow_service.rb @@ -15,6 +15,7 @@ class UnfollowService < BaseService def build_xml(follow) Nokogiri::XML::Builder.new do |xml| entry(xml, true) do + unique_id xml, Time.now.utc, follow.id, 'Follow' title xml, "#{follow.account.acct} is no longer following #{follow.target_account.acct}" author(xml) do |