[PLUGIN][RepeatNote] Add support for onGSVerbToActivityStreamsTwoActivityType

This commit is contained in:
Diogo Peralta Cordeiro 2021-12-12 06:49:14 +00:00
parent 8d1e000574
commit 630e22579e
Signed by: diogo
GPG Key ID: 18D2D35001FBFAB0
1 changed files with 14 additions and 5 deletions

View File

@ -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;
}
}