Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2021-12-14 19:33:57 +0300
committerJoas Schilling <coding@schilljs.com>2021-12-15 16:19:21 +0300
commit802d1d2f3e4af3e1a590fca7b6dc24c4115f30a4 (patch)
treed0297fa15eafc552063fef17c0d3557e1838fd81 /lib
parent32f822cea724fdc408eacbe7fde4459b98c4dd49 (diff)
Only for guests and self-joined users disconnecting is "leaving"
So only trigger a disinvite in those cases Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Signaling/Listener.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/Signaling/Listener.php b/lib/Signaling/Listener.php
index 1d9106d27..829218efc 100644
--- a/lib/Signaling/Listener.php
+++ b/lib/Signaling/Listener.php
@@ -35,6 +35,7 @@ use OCA\Talk\Events\RemoveUserEvent;
use OCA\Talk\Events\RoomEvent;
use OCA\Talk\GuestManager;
use OCA\Talk\Model\Session;
+use OCA\Talk\Participant;
use OCA\Talk\Room;
use OCA\Talk\Service\ParticipantService;
use OCA\Talk\Service\SessionService;
@@ -216,8 +217,16 @@ class Listener {
$sessionIds = [];
if ($event->getParticipant()->getSession()) {
- $sessionIds[] = $event->getParticipant()->getSession()->getSessionId();
- $notifier->roomSessionsRemoved($event->getRoom(), $sessionIds);
+ // Only for guests and self-joined users disconnecting is "leaving" and therefor should trigger a disinvite
+ $attendeeParticipantType = $event->getParticipant()->getAttendee()->getParticipantType();
+ if ($attendeeParticipantType === Participant::GUEST
+ || $attendeeParticipantType === Participant::GUEST_MODERATOR) {
+ $sessionIds[] = $event->getParticipant()->getSession()->getSessionId();
+ $notifier->roomSessionsRemoved($event->getRoom(), $sessionIds);
+ }
+ if ($attendeeParticipantType === Participant::USER_SELF_JOINED) {
+ $notifier->roomsDisinvited($event->getRoom(), [$event->getParticipant()->getAttendee()->getActorId()]);
+ }
}
});