Skip to content

Commit

Permalink
fix(federation): No notification for call summary and other system me…
Browse files Browse the repository at this point in the history
…ssages

Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Aug 15, 2024
1 parent fecf749 commit b4a8af6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/Notification/FederationChatNotifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ public function __construct(
* @param array{remoteServerUrl: string, sharedSecret: string, remoteToken: string, messageData: array{remoteMessageId: int, actorType: string, actorId: string, actorDisplayName: string, messageType: string, systemMessage: string, expirationDatetime: string, message: string, messageParameter: string, creationDatetime: string, metaData: string}, unreadInfo: array{unreadMessages: int, unreadMention: bool, unreadMentionDirect: bool, lastReadMessage: int}} $inboundNotification
*/
public function handleChatMessage(Room $room, Participant $participant, ProxyCacheMessage $message, array $inboundNotification): void {
if (!empty($inboundNotification['messageData']['systemMessage'])) {
return;
}

if ($participant->getAttendee()->getActorType() === $inboundNotification['messageData']['actorType']
&& $participant->getAttendee()->getActorId() === $inboundNotification['messageData']['actorId']) {
return;
Expand Down
6 changes: 6 additions & 0 deletions tests/integration/features/federation/call.feature
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,12 @@ Feature: federation/call
And user "participant2" has the following notifications
| app | object_type | object_id | subject |
| spreed | call | LOCAL::room | A group call has started in room |
And user "participant2" joins room "LOCAL::room" with 200 (v4)
When user "participant2" joins call "LOCAL::room" with 200 (v4)
And using server "LOCAL"
When user "participant1" ends call "room" with 200 (v4)
Then using server "REMOTE"
And user "participant2" has the following notifications

Scenario: normal call notification for federated user is cleared when joining
Given user "participant1" creates room "room" (v4)
Expand Down

0 comments on commit b4a8af6

Please sign in to comment.