Skip to content

Commit

Permalink
feat: Initial implementation of reactions notifications in federated …
Browse files Browse the repository at this point in the history
…convos

Signed-off-by: skalidindi53 <[email protected]>
  • Loading branch information
skalidindi53 committed Aug 29, 2024
1 parent bb9ce7a commit dcadd09
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions lib/Federation/Proxy/TalkV1/Notifier/MessageSentListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,10 @@ public function handle(Event $event): void {
$attendee = $participant->getAttendee();
$cloudId = $this->cloudIdManager->resolveCloudId($attendee->getActorId());

//Reaction Handling logic
if ($chatMessage->getMessageType() === ChatManager::VERB_REACTION){
$notificationLevel = $attendee->getNotificationLevel();

// Only notify if the notification level is set to always

if ($notificationLevel === Participant::NOTIFY_ALWAYS) {
// Create a federated notification for the reaction
$reactionMessageData = [
'subject' => 'reaction',
'subjectData' => [
Expand All @@ -117,7 +114,6 @@ public function handle(Event $event): void {
'dateTime' => $event->getComment()->getCreationDateTime()->format(\DateTime::ATOM),
];

// Send notification for reaction
$reactionSuccess = $this->backendNotifier->sendMessageUpdate(
$cloudId->getRemote(),
$attendee->getId(),
Expand All @@ -131,7 +127,6 @@ public function handle(Event $event): void {
$this->participantService->removeAttendee($event->getRoom(), $participant, AAttendeeRemovedEvent::REASON_LEFT);
}

// Continue to the next participant since this one has been notified
continue;
}
}
Expand Down Expand Up @@ -161,4 +156,4 @@ public function handle(Event $event): void {
}
}
}
}
}

0 comments on commit dcadd09

Please sign in to comment.