diff options
author | Joas Schilling <coding@schilljs.com> | 2024-02-19 12:59:19 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2024-02-23 14:33:05 +0100 |
commit | c1eaad19b58007f2fe9c9b062a2c885315a548f3 (patch) | |
tree | 1ae9c2c7be46e9cb8f310a17bed76342a2f6963e /lib/Controller | |
parent | 0f844978a36fba735a9bead87ca84f60e6b8e412 (diff) |
feat(federation): Proxy RoomController::getParticipants()
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Controller')
-rw-r--r-- | lib/Controller/ChatController.php | 7 | ||||
-rw-r--r-- | lib/Controller/RoomController.php | 8 |
2 files changed, 11 insertions, 4 deletions
diff --git a/lib/Controller/ChatController.php b/lib/Controller/ChatController.php index 57767e8a7..6108ea10e 100644 --- a/lib/Controller/ChatController.php +++ b/lib/Controller/ChatController.php @@ -1157,10 +1157,9 @@ class ChatController extends AEnvironmentAwareController { #[RequireReadWriteConversation] public function mentions(string $search, int $limit = 20, bool $includeStatus = false): DataResponse { if ($this->room->getRemoteServer()) { - $proxy = \OCP\Server::get(\OCA\Talk\Federation\Proxy\TalkV1\ChatController::class); - return new DataResponse( - $proxy->mentions($this->room, $this->participant, $search, $limit, $includeStatus) - ); + /** @var \OCA\Talk\Federation\Proxy\TalkV1\Controller\ChatController $proxy */ + $proxy = \OCP\Server::get(\OCA\Talk\Federation\Proxy\TalkV1\Controller\ChatController::class); + return $proxy->mentions($this->room, $this->participant, $search, $limit, $includeStatus); } $this->searchPlugin->setContext([ 'itemType' => 'chat', diff --git a/lib/Controller/RoomController.php b/lib/Controller/RoomController.php index 76e6fd189..73dc775ea 100644 --- a/lib/Controller/RoomController.php +++ b/lib/Controller/RoomController.php @@ -837,6 +837,12 @@ class RoomController extends AEnvironmentAwareController { #[RequireModeratorOrNoLobby] #[RequireParticipant] public function getParticipants(bool $includeStatus = false): DataResponse { + if ($this->room->getRemoteServer()) { + /** @var \OCA\Talk\Federation\Proxy\TalkV1\Controller\RoomController $proxy */ + $proxy = \OCP\Server::get(\OCA\Talk\Federation\Proxy\TalkV1\Controller\RoomController::class); + return $proxy->getParticipants($this->room, $this->participant, $includeStatus); + } + if ($this->participant->getAttendee()->getParticipantType() === Participant::GUEST) { return new DataResponse([], Http::STATUS_FORBIDDEN); } @@ -1011,6 +1017,8 @@ class RoomController extends AEnvironmentAwareController { $result['displayName'] = $participant->getAttendee()->getDisplayName(); } elseif ($participant->getAttendee()->getActorType() === Attendee::ACTOR_CIRCLES) { $result['displayName'] = $participant->getAttendee()->getDisplayName(); + } elseif ($participant->getAttendee()->getActorType() === Attendee::ACTOR_FEDERATED_USERS) { + $result['displayName'] = $participant->getAttendee()->getDisplayName(); } elseif ($participant->getAttendee()->getActorType() === Attendee::ACTOR_PHONES) { $result['displayName'] = $participant->getAttendee()->getDisplayName(); if ($this->talkConfig->isSIPConfigured() |