From 985ef99590b6b03d5420ffe0e6afd8ca3e034ce2 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Wed, 28 Dec 2022 05:15:25 +0000 Subject: [PATCH 1/3] activitypub: create: fix up quoteUri/quoteUrl/quoteURL handling --- app/lib/activitypub/activity/create.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/lib/activitypub/activity/create.rb b/app/lib/activitypub/activity/create.rb index 47ab1b6963a..4fb3e3dc9f0 100644 --- a/app/lib/activitypub/activity/create.rb +++ b/app/lib/activitypub/activity/create.rb @@ -429,8 +429,12 @@ class ActivityPub::Activity::Create < ActivityPub::Activity end def guess_quote_url - if @object["quoteUrl"] && !@object["quoteUrl"].empty? + if @object["quoteUri"] && !@object["quoteUri"].empty? + @object["quoteUri"] + elsif @object["quoteUrl"] && !@object["quoteUrl"].empty? @object["quoteUrl"] + elsif @object["quoteURL"] && !@object["quoteURL"].empty? + @object["quoteURL"] elsif @object["_misskey_quote"] && !@object["_misskey_quote"].empty? @object["_misskey_quote"] else From 418fffcb410b4811e26eee7a9d55290305d0b511 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Wed, 28 Dec 2022 06:06:49 +0000 Subject: [PATCH 2/3] models: status edit: pass through quote information to parent status --- app/models/status_edit.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/models/status_edit.rb b/app/models/status_edit.rb index c2330c04fad..c4778d908a9 100644 --- a/app/models/status_edit.rb +++ b/app/models/status_edit.rb @@ -62,6 +62,10 @@ class StatusEdit < ApplicationRecord end end + def quote? + status.quote? + end + def proper self end From 9c51dc8dd535c08f7f0a8da1bfe8db62fa24248d Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Wed, 28 Dec 2022 06:48:24 +0000 Subject: [PATCH 3/3] activitypub: tag manager: ensure that a quote post has the OP included in to field --- app/lib/activitypub/tag_manager.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/lib/activitypub/tag_manager.rb b/app/lib/activitypub/tag_manager.rb index 3d6b28ef581..a8e29d20432 100644 --- a/app/lib/activitypub/tag_manager.rb +++ b/app/lib/activitypub/tag_manager.rb @@ -77,11 +77,15 @@ class ActivityPub::TagManager # Unlisted and private statuses go out primarily to the followers collection # Others go out only to the people they mention def to(status) + to = [] + + to << uri_for(status.quote.account) if status.quote? + case status.visibility when 'public' - [COLLECTIONS[:public]] + to << COLLECTIONS[:public] when 'unlisted', 'private' - [account_followers_url(status.account)] + to << account_followers_url(status.account) when 'direct', 'limited' if status.account.silenced? # Only notify followers if the account is locally silenced