From 5a01ed41f9ca52ac28e77c19001f98dcbcd96ea2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=BCller?= Date: Thu, 25 Jun 2026 11:18:26 +0200 Subject: [PATCH 1/2] feat: Add last-common-read to chat relay MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcel Müller --- lib/Signaling/Listener.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Signaling/Listener.php b/lib/Signaling/Listener.php index 898522217b3..f4f552eee61 100644 --- a/lib/Signaling/Listener.php +++ b/lib/Signaling/Listener.php @@ -530,6 +530,7 @@ protected function notifyMessageSent(AMessageSentEvent $event): void { $thread = null; } $data['chat']['comment'] = $message->toArray('json', $thread); + $data['chat']['comment']['lastCommonRead'] = $this->participantService->getLastCommonReadChatMessage($room); $parent = $event->getParent(); if ($parent !== null) { @@ -593,6 +594,7 @@ protected function notifySystemMessageSent(ASystemMessageSentEvent $event): void } $data['chat']['comment'] = $message->toArray('json', $thread); + $data['chat']['comment']['lastCommonRead'] = $this->participantService->getLastCommonReadChatMessage($room); if ($messageType === 'call_started') { $metaData = $comment->getMetaData() ?? []; @@ -701,6 +703,7 @@ protected function notifyReactionSent(AReactionEvent $event): void { 'markdown' => false , 'expirationTimestamp' => $message->getExpirationDateTime()?->getTimestamp() ?? 0, 'threadId' => $threadId, + 'lastCommonRead' => $this->participantService->getLastCommonReadChatMessage($room), ]; $data['chat']['comment']['parent'] = $message->toArray('json', $thread); From 5ba63c39e3cef4e3e0ff838913ae520f4dcf10f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=BCller?= Date: Thu, 25 Jun 2026 12:01:53 +0200 Subject: [PATCH 2/2] test: Adjust for chat relay common-last-read MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcel Müller --- tests/php/Signaling/ListenerTest.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/tests/php/Signaling/ListenerTest.php b/tests/php/Signaling/ListenerTest.php index 03255ced205..89e0f2e98c5 100644 --- a/tests/php/Signaling/ListenerTest.php +++ b/tests/php/Signaling/ListenerTest.php @@ -290,7 +290,9 @@ public function testChatMessageSentEvent(): void { $comment->method('getId')->willReturn(1); $message = $this->createConfiguredMock(Message::class, [ 'getVisibility' => true, - 'toArray' => [], + 'toArray' => [ + 'id' => 123, + ], 'getMessageId' => 123, ]); $l10n = $this->createStub(IL10N::class); @@ -317,7 +319,10 @@ public function testChatMessageSentEvent(): void { 'type' => 'chat', 'chat' => [ 'refresh' => true, - 'comment' => [], + 'comment' => [ + 'id' => 123, + 'lastCommonRead' => 0, + ], ], ]); @@ -333,7 +338,9 @@ public function testChatMessageSentWithThreadEvent(): void { $comment->method('getId')->willReturn(1); $message = $this->createConfiguredMock(Message::class, [ 'getVisibility' => true, - 'toArray' => [], + 'toArray' => [ + 'id' => 123, + ], 'getMessageId' => 123, ]); @@ -365,7 +372,10 @@ public function testChatMessageSentWithThreadEvent(): void { 'type' => 'chat', 'chat' => [ 'refresh' => true, - 'comment' => [], + 'comment' => [ + 'id' => 123, + 'lastCommonRead' => 0, + ], ], ]);