Skip to content

Commit

Permalink
fix(federation): Don't break/throttle when the invite was not accepted
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen committed Feb 29, 2024
1 parent c84be51 commit fcffe85
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/Federation/CloudFederationProviderTalk.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,14 @@ private function shareUnshared(int $remoteAttendeeId, array $notification): arra
}

$this->invitationMapper->delete($invite);
$participant = $this->participantService->getParticipantByActor($room, Attendee::ACTOR_USERS, $invite->getUserId());
$this->participantService->removeAttendee($room, $participant, AAttendeeRemovedEvent::REASON_REMOVED);

try {
$participant = $this->participantService->getParticipantByActor($room, Attendee::ACTOR_USERS, $invite->getUserId());
$this->participantService->removeAttendee($room, $participant, AAttendeeRemovedEvent::REASON_REMOVED);
} catch (ParticipantNotFoundException) {
// Never accepted the invite
}

return [];
}

Expand Down Expand Up @@ -373,7 +379,8 @@ private function messagePosted(int $remoteAttendeeId, array $notification): arra
try {
$participant = $this->participantService->getParticipant($room, $invite->getUserId(), false);
} catch (ParticipantNotFoundException) {
throw new ShareNotFound();
// Not accepted the invite yet
return [];
}

$this->participantService->updateUnreadInfoForProxyParticipant(
Expand Down

0 comments on commit fcffe85

Please sign in to comment.