From 526de8e3ae5ea5ce6269a0bf814885c8076fd7dc Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Fri, 29 Jan 2021 10:49:13 +0100 Subject: Return self-joined users in add participant search Signed-off-by: Vincent Petry --- lib/Collaboration/Collaborators/Listener.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/Collaboration') diff --git a/lib/Collaboration/Collaborators/Listener.php b/lib/Collaboration/Collaborators/Listener.php index b5b2136ef..a697675c7 100644 --- a/lib/Collaboration/Collaborators/Listener.php +++ b/lib/Collaboration/Collaborators/Listener.php @@ -27,6 +27,7 @@ use OCA\Talk\Config; use OCA\Talk\Exceptions\ParticipantNotFoundException; use OCA\Talk\Exceptions\RoomNotFoundException; use OCA\Talk\Manager; +use OCA\Talk\Participant; use OCA\Talk\Room; use OCP\Collaboration\AutoComplete\AutoCompleteEvent; use OCP\Collaboration\AutoComplete\IManager; @@ -127,7 +128,11 @@ class Listener { $userId = $result['value']['shareWith']; try { - $this->room->getParticipant($userId); + $participant = $this->room->getParticipant($userId); + if ($participant->getAttendee()->getParticipantType() === Participant::USER_SELF_JOINED) { + // do list self-joined users so they can be added as permanent participants by moderators + return true; + } return false; } catch (ParticipantNotFoundException $e) { return true; -- cgit v1.2.3