diff --git a/lib/Notification/Notifier.php b/lib/Notification/Notifier.php index 6760dc9c875..8fffb285d2c 100644 --- a/lib/Notification/Notifier.php +++ b/lib/Notification/Notifier.php @@ -378,6 +378,10 @@ protected function parseChatMessage(INotification $notification, Room $room, Par throw new AlreadyProcessedException(); } + if ($message->getMessageType() === 'comment_deleted') { + throw new AlreadyProcessedException(); + } + $placeholders = $replacements = []; foreach ($message->getMessageParameters() as $placeholder => $parameter) { $placeholders[] = '{' . $placeholder . '}'; diff --git a/tests/integration/features/chat/notifications.feature b/tests/integration/features/chat/notifications.feature index 467e421753c..4d62db44c7d 100644 --- a/tests/integration/features/chat/notifications.feature +++ b/tests/integration/features/chat/notifications.feature @@ -214,3 +214,18 @@ Feature: chat/notifications When user "participant1" sends message "Hi @all bye" to room "room" with 201 Then user "participant2" has the following notifications | app | object_type | object_id | subject | + + Scenario: Delete notification when the message is deleted + When user "participant1" creates room "one-to-one room" (v4) + | roomType | 1 | + | invite | participant2 | + # Join and leave to clear the invite notification + Given user "participant2" joins room "one-to-one room" with 200 (v4) + And user "participant2" leaves room "one-to-one room" with 200 (v4) + And user "participant1" sends message "Message 1" to room "one-to-one room" with 201 + Then user "participant2" has the following notifications + | app | object_type | object_id | subject | + | spreed | chat | one-to-one room/Message 1 | participant1-displayname sent you a private message | + When user "participant1" deletes message "Message 1" from room "one-to-one room" with 200 (v1) + Then user "participant2" has the following notifications + | app | object_type | object_id | subject |