[COMPONENT][Posting] Page should flush with a different notification

This commit is contained in:
2022-02-16 19:35:27 +00:00
parent b6ed0b4c6c
commit b69f4a46c5
3 changed files with 40 additions and 30 deletions

View File

@@ -80,7 +80,7 @@ class RepeatNote extends NoteHandlerPlugin
$original_note_id = $note->getId();
// Create a new note with the same content as the original
$repeat = Posting::storeLocalNote(
[, $repeat, ] = Posting::storeLocalNote(
actor: Actor::getById($actor_id),
content: $note->getContent(),
content_type: $note->getContentType(),
@@ -88,7 +88,7 @@ class RepeatNote extends NoteHandlerPlugin
// If it's a repeat, the reply_to should be to the original, conversation ought to be the same
reply_to: $note->getReplyTo(),
processed_attachments: $note->getAttachmentsWithTitle(),
notify: false,
flush_and_notify: false,
rendered: $note->getRendered(),
);
@@ -110,6 +110,9 @@ class RepeatNote extends NoteHandlerPlugin
]);
DB::persist($repeat_activity);
// Flush before notification
DB::flush();
Event::handle('NewNotification', [$actor = Actor::getById($actor_id), $repeat_activity, [], _m('{nickname} repeated note {note_id}.', ['{nickname}' => $actor->getNickname(), '{note_id}' => $repeat_activity->getObjectId()])]);
return $repeat_activity;