Skip to content

Commit

Permalink
fix(federation): Also translate last editor handling
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen committed Feb 22, 2024
1 parent 6b4ae53 commit 25a81fe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/Federation/Proxy/TalkV1/Controller/ChatController.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ public function receiveMessages(
$data = $this->proxy->getOCSData($proxy);
/** @var TalkChatMessageWithParent[] $data */
$data = $this->userConverter->convertAttendees($room, $data, 'actorType', 'actorId', 'actorDisplayName');
$data = $this->userConverter->convertAttendees($room, $data, 'lastEditActorType', 'lastEditActorId', 'lastEditActorDisplayName');

return new DataResponse($data, Http::STATUS_OK, $headers);
}
Expand Down Expand Up @@ -212,6 +213,7 @@ public function getMessageContext(Room $room, Participant $participant, int $mes
$data = $this->proxy->getOCSData($proxy);
/** @var TalkChatMessageWithParent[] $data */
$data = $this->userConverter->convertAttendees($room, $data, 'actorType', 'actorId', 'actorDisplayName');
$data = $this->userConverter->convertAttendees($room, $data, 'lastEditActorType', 'lastEditActorId', 'lastEditActorDisplayName');

return new DataResponse($data, Http::STATUS_OK, $headers);
}
Expand Down Expand Up @@ -259,6 +261,7 @@ public function editMessage(Room $room, Participant $participant, int $messageId
$data = $this->proxy->getOCSData($proxy, [Http::STATUS_OK, Http::STATUS_ACCEPTED]);
if (!empty($data)) {
$data = $this->userConverter->convertAttendee($room, $data, 'actorType', 'actorId', 'actorDisplayName');
$data = $this->userConverter->convertAttendee($room, $data, 'lastEditActorType', 'lastEditActorId', 'lastEditActorDisplayName');
} else {
$data = null;
}
Expand Down Expand Up @@ -315,6 +318,7 @@ public function deleteMessage(Room $room, Participant $participant, int $message
$data = $this->proxy->getOCSData($proxy, [Http::STATUS_OK, Http::STATUS_ACCEPTED]);
if (!empty($data)) {
$data = $this->userConverter->convertAttendee($room, $data, 'actorType', 'actorId', 'actorDisplayName');
$data = $this->userConverter->convertAttendee($room, $data, 'lastEditActorType', 'lastEditActorId', 'lastEditActorDisplayName');
} else {
$data = null;
}
Expand Down

0 comments on commit 25a81fe

Please sign in to comment.