From 9698f4bc606d892bb1a2df86498c57b1de33a3d9 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 9 Oct 2023 14:25:35 +0200 Subject: [PATCH] Fix federated user handling in chat Signed-off-by: Joas Schilling --- lib/Chat/MessageParser.php | 3 +++ lib/Controller/ChatController.php | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/Chat/MessageParser.php b/lib/Chat/MessageParser.php index d9a822f7cc1..5b2aaa45d8f 100644 --- a/lib/Chat/MessageParser.php +++ b/lib/Chat/MessageParser.php @@ -112,6 +112,9 @@ protected function setActor(Message $message): void { $displayName = $botName . ' (Bot)'; } } + } elseif ($comment->getActorType() === Attendee::ACTOR_FEDERATED_USERS) { + // FIXME Read from some addressbooks? + $displayName = $actorId; } $message->setActor( diff --git a/lib/Controller/ChatController.php b/lib/Controller/ChatController.php index 25f6548ecd4..01a9d2849bf 100644 --- a/lib/Controller/ChatController.php +++ b/lib/Controller/ChatController.php @@ -118,7 +118,10 @@ public function __construct( } protected function getActorInfo(string $actorDisplayName = ''): array { - if ($this->userId === null) { + if ($this->getRemoteAccessCloudId()) { + $actorType = Attendee::ACTOR_FEDERATED_USERS; + $actorId = $this->getRemoteAccessCloudId(); + } elseif ($this->userId === null) { $actorType = Attendee::ACTOR_GUESTS; $actorId = $this->participant->getAttendee()->getActorId();