Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/Notification/Notifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 . '}';
Expand Down
15 changes: 15 additions & 0 deletions tests/integration/features/chat/notifications.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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 |