From edec72e148de2d6579d0806acd691d28d7e893b7 Mon Sep 17 00:00:00 2001 From: Anna Larch Date: Mon, 17 Feb 2025 14:42:19 +0100 Subject: [PATCH] feat(conversation): add federated typing indicator Signed-off-by: Anna Larch --- lib/Controller/RoomController.php | 2 +- lib/Federation/Proxy/TalkV1/ProxyRequest.php | 1 - .../features/federation/chat.feature | 26 +++++++++++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/lib/Controller/RoomController.php b/lib/Controller/RoomController.php index 1a7ed2f3df8..361394b8be4 100644 --- a/lib/Controller/RoomController.php +++ b/lib/Controller/RoomController.php @@ -2547,7 +2547,7 @@ public function getCapabilities(): DataResponse { $data['config']['chat']['read-privacy'] = Participant::PRIVACY_PRIVATE; } if (isset($data['config']['chat']['typing-privacy'])) { - $data['config']['chat']['typing-privacy'] = Participant::PRIVACY_PRIVATE; + $data['config']['chat']['typing-privacy'] = $this->talkConfig->getUserTypingPrivacy($this->userId); } if (isset($data['config']['call']['start-without-media'])) { $data['config']['call']['start-without-media'] = $this->talkConfig->getCallsStartWithoutMedia($this->userId); diff --git a/lib/Federation/Proxy/TalkV1/ProxyRequest.php b/lib/Federation/Proxy/TalkV1/ProxyRequest.php index 5a597dbd979..ad731359b8e 100644 --- a/lib/Federation/Proxy/TalkV1/ProxyRequest.php +++ b/lib/Federation/Proxy/TalkV1/ProxyRequest.php @@ -40,7 +40,6 @@ public function overwrittenRemoteTalkHash(string $hash): string { 'config' => [ 'chat' => [ 'read-privacy', - 'typing-privacy', ], 'call' => [ 'blur-virtual-background', diff --git a/tests/integration/features/federation/chat.feature b/tests/integration/features/federation/chat.feature index 99c85a36ed7..4738db4591b 100644 --- a/tests/integration/features/federation/chat.feature +++ b/tests/integration/features/federation/chat.feature @@ -501,3 +501,29 @@ Feature: federation/chat | actorType | actorId | actorDisplayName | reaction | | users | participant1 | participant1-displayname | 🚀 | | federated_users | participant2@{$REMOTE_URL} | participant2-displayname | 🚀 | + + + Scenario: Typing indicator + Given user "participant1" creates room "room" (v4) + | roomType | 2 | + | roomName | room | + And user "participant1" adds federated_user "participant2" to room "room" with 200 (v4) + And using server "REMOTE" + And user "participant2" has the following invitations (v1) + | remoteServerUrl | remoteToken | state | inviterCloudId | inviterDisplayName | + | LOCAL | room | 0 | participant1@LOCAL | participant1-displayname | + And user "participant2" accepts invite to room "room" of server "LOCAL" with 200 (v1) + | id | name | type | remoteServer | remoteToken | + | LOCAL::room | room | 2 | LOCAL | room | + Then user "participant2" is participant of the following rooms (v4) + | id | type | + | LOCAL::room | 2 | + # Join and leave to clear the invite notification + Given user "participant2" joins room "LOCAL::room" with 200 (v4) + Given user "participant2" leaves room "LOCAL::room" with 200 (v4) + And using server "LOCAL" + When user "participant1" sets setting "typing_privacy" to 1 with 200 (v1) + Then user "participant1" has capability "spreed=>config=>chat=>typing-privacy" set to 1 + # Public + When user "participant1" sets setting "typing_privacy" to 0 with 200 (v1) + Then user "participant1" has capability "spreed=>config=>chat=>typing-privacy" set to 0