Skip to content

Commit

Permalink
Merge pull request #11745 from nextcloud/bugfix/noid/remove-status-fr…
Browse files Browse the repository at this point in the history
…om-participant-proxy

fix(federation): Don't request user status from remote instances
  • Loading branch information
nickvergessen authored Mar 7, 2024
2 parents 4330774 + decbeeb commit 5538902
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/Controller/RoomController.php
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ 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);
return $proxy->getParticipants($this->room, $this->participant);
}

if ($this->participant->getAttendee()->getParticipantType() === Participant::GUEST) {
Expand Down
7 changes: 2 additions & 5 deletions lib/Federation/Proxy/TalkV1/Controller/RoomController.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,17 @@ public function __construct(
* 200: Participants returned
* 403: Missing permissions for getting participants
*/
public function getParticipants(Room $room, Participant $participant, bool $includeStatus = false): DataResponse {
public function getParticipants(Room $room, Participant $participant): DataResponse {
$proxy = $this->proxy->get(
$participant->getAttendee()->getInvitedCloudId(),
$participant->getAttendee()->getAccessToken(),
$room->getRemoteServer() . '/ocs/v2.php/apps/spreed/api/v4/room/' . $room->getRemoteToken() . '/participants',
[
'includeStatus' => $includeStatus,
],
);

/** @var TalkParticipant[] $data */
$data = $this->proxy->getOCSData($proxy);

// FIXME post-load status information
// FIXME post-load status information of now local users
/** @var TalkParticipant[] $data */
$data = $this->userConverter->convertAttendees($room, $data, 'actorType', 'actorId', 'displayName');
$headers = [];
Expand Down

0 comments on commit 5538902

Please sign in to comment.