diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2023-05-02 22:01:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-02 22:01:51 +0200 |
commit | c4fee5eec162fc146c9000f171ea4d4273fc70de (patch) | |
tree | 67e21c45ef8ec7c06f0af439a666c9b69261813f /lib | |
parent | e1bb98efcd1017bcc7b9b8cdef5386cfd38e2be7 (diff) | |
parent | 0cf8800f20bc8a7b3c6368288a3d622bbf5c0d28 (diff) |
Merge pull request #9412 from nextcloud/bugfix/8787/keep-guest-attendees-with-values
Bugfix/8787/keep guest attendees with values
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Controller/RoomController.php | 15 | ||||
-rw-r--r-- | lib/Service/ParticipantService.php | 12 |
2 files changed, 24 insertions, 3 deletions
diff --git a/lib/Controller/RoomController.php b/lib/Controller/RoomController.php index 787a2d63d..920624aa6 100644 --- a/lib/Controller/RoomController.php +++ b/lib/Controller/RoomController.php @@ -829,9 +829,18 @@ class RoomController extends AEnvironmentAwareController { $result['statusClearAt'] = null; } } elseif ($participant->getAttendee()->getActorType() === Attendee::ACTOR_GUESTS) { - if ($result['lastPing'] <= $maxPingAge) { - $cleanGuests = true; - continue; + if ($participant->getAttendee()->getParticipantType() === Participant::GUEST + && ($participant->getAttendee()->getPermissions() === Attendee::PERMISSIONS_DEFAULT + || $participant->getAttendee()->getPermissions() === Attendee::PERMISSIONS_CUSTOM)) { + // Guests without an up-to-date session are filtered out. We + // only keep there attendees in the database, so that the + // comments show the display name. Only when they have + // non-default permissions we show them, so permissions can + // be reset or removed + if ($result['lastPing'] <= $maxPingAge) { + $cleanGuests = true; + continue; + } } $result['displayName'] = $participant->getAttendee()->getDisplayName(); diff --git a/lib/Service/ParticipantService.php b/lib/Service/ParticipantService.php index afb33ac07..225f32986 100644 --- a/lib/Service/ParticipantService.php +++ b/lib/Service/ParticipantService.php @@ -1001,6 +1001,18 @@ class ParticipantService { $attendees = []; $result = $query->executeQuery(); while ($row = $result->fetch()) { + if ($row['display_name'] !== '' && $row['display_name'] !== null) { + // Keep guests with a non-empty display name, so we can still + // render the guest display name on chat messages. + continue; + } + + if ($row['permissions'] !== Attendee::PERMISSIONS_DEFAULT + || $row['participant_type'] === Participant::GUEST_MODERATOR) { + // Keep guests with non-default permissions in case they just reconnect + continue; + } + $attendeeIds[] = (int) $row['a_id']; $attendees[] = $this->attendeeMapper->createAttendeeFromRow($row); } |