logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe
commit: 8e08ae5bb91868d727fdd877aba0133744ad9934
parent: df63461ff091f6b513c797d010f82dee73f437b2
Author: Eugen Rochko <eugen@zeonfederated.com>
Date:   Mon, 13 Feb 2017 13:30:33 +0100

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.

Diffstat:

Mapp/services/authorize_follow_service.rb3+++
Mapp/services/block_service.rb1+
Mapp/services/favourite_service.rb2++
Mapp/services/follow_service.rb2++
Mapp/services/reject_follow_service.rb3+++
Mapp/services/unblock_service.rb1+
Mapp/services/unfavourite_service.rb2++
Mapp/services/unfollow_service.rb1+
8 files changed, 15 insertions(+), 0 deletions(-)

diff --git 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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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