From 630e22579e7eda12ba206032261f3470674c0056 Mon Sep 17 00:00:00 2001 From: Diogo Peralta Cordeiro Date: Sun, 12 Dec 2021 06:49:14 +0000 Subject: [PATCH] [PLUGIN][RepeatNote] Add support for onGSVerbToActivityStreamsTwoActivityType --- plugins/RepeatNote/RepeatNote.php | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/plugins/RepeatNote/RepeatNote.php b/plugins/RepeatNote/RepeatNote.php index 5ac63cfb6b..b5236c424a 100644 --- a/plugins/RepeatNote/RepeatNote.php +++ b/plugins/RepeatNote/RepeatNote.php @@ -53,11 +53,11 @@ class RepeatNote extends NoteHandlerPlugin if (!\is_null($repeat_entity)) { return DB::findBy('activity', [ - 'actor_id' => $actor_id, - 'verb' => 'repeat', - 'object_type' => 'note', - 'object_id' => $note->getId(), - ], order_by: ['created' => 'dsc'])[0]; + 'actor_id' => $actor_id, + 'verb' => 'repeat', + 'object_type' => 'note', + 'object_id' => $note->getId() + ], order_by: ['created' => 'DESC'])[0]; } // Create a new note with the same content as the original @@ -337,4 +337,13 @@ class RepeatNote extends NoteHandlerPlugin { return $this->activitypub_handler($actor, $type_activity, $type_object, $ap_act); } + + public function onGSVerbToActivityStreamsTwoActivityType(string $verb, ?string &$gs_verb_to_activity_stream_two_verb): bool + { + if ($verb === 'repeat') { + $gs_verb_to_activity_stream_two_verb = 'Announce'; + return Event::stop; + } + return Event::next; + } }