From 8f76ddd4e760feaa293b1acf8c55b7e82c237566 Mon Sep 17 00:00:00 2001 From: Hamza Date: Sun, 26 Apr 2026 16:59:39 +0200 Subject: [PATCH 1/2] feat(talk-backend): expose whether talk is enabled for user Signed-off-by: Hamza --- lib/OCP/TalkBackend.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/lib/OCP/TalkBackend.php b/lib/OCP/TalkBackend.php index 35498b6a07d..1666692ffd0 100644 --- a/lib/OCP/TalkBackend.php +++ b/lib/OCP/TalkBackend.php @@ -9,6 +9,7 @@ namespace OCA\Talk\OCP; +use OCA\Talk\Config; use OCA\Talk\Manager; use OCA\Talk\Model\Attendee; use OCA\Talk\Participant; @@ -16,6 +17,7 @@ use OCA\Talk\Service\ParticipantService; use OCA\Talk\Service\RoomService; use OCP\IURLGenerator; +use OCP\IUserSession; use OCP\Talk\IConversation; use OCP\Talk\IConversationOptions; use OCP\Talk\ITalkBackend; @@ -27,6 +29,8 @@ public function __construct( protected ParticipantService $participantService, protected RoomService $roomService, protected IURLGenerator $url, + protected IUserSession $userSession, + protected Config $config, ) { } @@ -68,4 +72,23 @@ public function deleteConversation(string $id): void { $room = $this->manager->getRoomByToken($id); $this->roomService->deleteRoom($room); } + + #[\Override] + public function isAllowedToCreateConversations(): bool { + $user = $this->userSession->getUser(); + if ($user === null) { + return false; + } + + return !$this->config->isNotAllowedToCreateConversations($user); + } + + #[\Override] + public function isEnabledForUser(): bool { + $user = $this->userSession->getUser(); + if ($user === null) { + return false; + } + return !$this->config->isDisabledForUser($user); + } } From 3566c5acfa441cf951d9cb04beddc2cdc1f27485 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 4 May 2026 12:49:46 +0200 Subject: [PATCH 2/2] fix(Override): Remove override for now so Talk can be run on older servers Signed-off-by: Joas Schilling --- lib/OCP/TalkBackend.php | 2 -- tests/psalm-baseline.xml | 8 +++++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/OCP/TalkBackend.php b/lib/OCP/TalkBackend.php index 1666692ffd0..a09e543f193 100644 --- a/lib/OCP/TalkBackend.php +++ b/lib/OCP/TalkBackend.php @@ -73,7 +73,6 @@ public function deleteConversation(string $id): void { $this->roomService->deleteRoom($room); } - #[\Override] public function isAllowedToCreateConversations(): bool { $user = $this->userSession->getUser(); if ($user === null) { @@ -83,7 +82,6 @@ public function isAllowedToCreateConversations(): bool { return !$this->config->isNotAllowedToCreateConversations($user); } - #[\Override] public function isEnabledForUser(): bool { $user = $this->userSession->getUser(); if ($user === null) { diff --git a/tests/psalm-baseline.xml b/tests/psalm-baseline.xml index 7036a081c27..e73d12b0436 100644 --- a/tests/psalm-baseline.xml +++ b/tests/psalm-baseline.xml @@ -1,5 +1,5 @@ - + @@ -150,6 +150,12 @@ rooms]]> + + + + + +