diff --git a/docs/settings.md b/docs/settings.md
index ed1c15445ec..99b08c6b08b 100644
--- a/docs/settings.md
+++ b/docs/settings.md
@@ -68,21 +68,21 @@ Legend:
| Key | Internal type | Default | Hash | Option | Valid values |
|--------------------------------------|------------------------------------------------------------------|-------------|------|--------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-| `allowed_groups` | string[] | `[]` | Yes | 🖌️ | List of group ids that are allowed to use Talk |
-| `sip_bridge_groups` | string[] | `[]` | Yes | 🖌️ | List of group ids that are allowed to enable SIP dial-in in a conversation |
-| `start_conversations` | string[] | `[]` | Yes | 🖌️ | List of group ids that are allowed to create conversations |
-| `start_calls_groups` | string[] | `[]` | Yes | 🖌️ | List of group ids that are allowed to start calls (everyone when empty). This also applies to moderators; guests and federated users can then never start calls. For federated conversations the host server decides. Others can still chat and join ongoing calls |
-| `federation_allowed_groups` | string[] | `[]` | Yes | 🖌️ | 🏗️ *Work in progress:* List of group ids that are allowed to invite federated users into their conversations (everyone when empty) |
-| `hosted-signaling-server-account` | array | `{}` | No | 🖌️ | Account information of the hosted signaling server |
-| `stun_servers` | string[] | `[]` | Yes | 🖌💻️ | List of STUN servers, should be configured via the web interface or the OCC commands |
-| `turn_servers` | array[] | `[]` | Yes | 🖌️💻 | List of TURN servers, should be configured via the web interface or the OCC commands |
-| `recording_servers` | array[] | `[]` | Yes | 🖌️ | List of recording servers, should be configured via the web interface |
-| `signaling_servers` | array[] | `[]` | Yes | 🖌️💻 | List of signaling servers, should be configured via the web interface or the OCC commands |
-| `sip_bridge_dialin_info` | string | | Yes | 🖌️ | Additional information added in the SIP dial-in invitation mail and sidebar |
+| `allowed_groups` | string[] | `[]` | Yes | 🖌️ | List of group ids that are allowed to use Talk |
+| `sip_bridge_groups` | string[] | `[]` | Yes | 🖌️ | List of group ids that are allowed to enable SIP dial-in in a conversation |
+| `start_conversations` | string[] | `[]` | Yes | 🖌️ | List of group ids that are allowed to create conversations |
+| `start_calls_groups` | string[] | `[]` | Yes | 🖌️ | List of group ids that are allowed to start calls (everyone when empty). This also applies to moderators; guests and federated users can then never start calls. For federated conversations the host server decides. Others can still chat and join ongoing calls |
+| `federation_allowed_groups` | string[] | `[]` | Yes | 🖌️ | 🏗️ *Work in progress:* List of group ids that are allowed to invite federated users into their conversations (everyone when empty) |
+| `hosted-signaling-server-account` | array | `{}` | No | 🖌️ | Account information of the hosted signaling server |
+| `stun_servers` | string[] | `[]` | Yes | 🖌💻️ | List of STUN servers, should be configured via the web interface or the OCC commands |
+| `turn_servers` | array[] | `[]` | Yes | 🖌️💻 | List of TURN servers, should be configured via the web interface or the OCC commands |
+| `recording_servers` | array[] | `[]` | Yes | 🖌️ | List of recording servers, should be configured via the web interface |
+| `signaling_servers` | array[] | `[]` | Yes | 🖌️💻 | List of signaling servers, should be configured via the web interface or the OCC commands |
+| `sip_bridge_dialin_info` | string | | Yes | 🖌️ | Additional information added in the SIP dial-in invitation mail and sidebar |
| `sip_bridge_dialout_anonymous` | bool | `false` | No | | When set to true, all out-going SIP calls will be anonymous calls (CLIR) |
| `sip_bridge_dialout_number` | string | | No | | Fallback phone number that is used as caller for out-going calls when the user has no phone-number configured (has to be E164 `+49123456789` formatted) |
| `sip_bridge_dialout_prefix` | string | `+` | No | | Prefix that is added before the first configured phone-number of a user to make it a valid E164 number to be used as a caller for out-going calls |
-| `sip_bridge_shared_secret` | string | | Yes | 🖌️ | Shared secret allowing the SIP bridge to authenticate on the Nextcloud server |
+| `sip_bridge_shared_secret` | string | | Yes | 🖌️ | Shared secret allowing the SIP bridge to authenticate on the Nextcloud server |
| `signaling_ticket_secret` | string | | Yes | | Secret used to secure the signaling tickets for guests (255 character random string) |
| `signaling_token_alg` | string
`ES256`, `ES384`, `RS256`, `RS384`, `RS512` or `EdDSA` | `ES256` | Yes | | Algorithm for the signaling tickets |
| `signaling_token_privkey_*` | string | * | Yes | | Private key for the signaling ticket creation by the server |
@@ -93,53 +93,53 @@ Legend:
| `bridge_bot_password` | string | | No | | Automatically generated password of the matterbridge bot user profile |
| `default_attachment_folder` | string | `/Talk` | No | | Specify default attachment folder location |
| `samples_directory` | string | | No | | Specify a readable directory that contains other sample conversation data |
-| `start_calls` | int | `0` | Yes | 🖌️ | Who can start a call, see [constants list](constants.md#start-call) |
+| `start_calls` | int | `0` | Yes | 🖌️ | Who can start a call, see [constants list](constants.md#start-call) |
| `max_call_duration` | int | `0` | No | | Maximum duration of a call in seconds, 0 for unlimited. Federated calls will be terminated based on the setting of the host server. Calls are ended via a background job, so system cron should be used and calls will last a bit longer (until the next execution of the cron). |
| `max-gif-size` | int | `3145728` | No | | Maximum file size for clients to render gifs previews with animation |
| `session-ping-limit` | int | `200` | No | | Number of sessions the HPB can ping in a single request |
| `token_entropy` | int | `8` | No | | Length of conversation tokens, can be increased to make tokens harder to guess but reduces readability and dial-in comfort |
-| `default_group_notification` | int | `1` | No | 🖌️ | Default notification level for group conversations [constants list](constants.md#participant-notification-levels) (Default changed from 2 (mentions) to 1 (always) in Nextcloud 33 for new installations) |
+| `default_group_notification` | int | `1` | No | 🖌️ | Default notification level for group conversations [constants list](constants.md#participant-notification-levels) (Default changed from 2 (mentions) to 1 (always) in Nextcloud 33 for new installations) |
| `default_permissions` | int | `246` | Yes | | Default permissions for non-moderators (see [constants list](constants.md#attendee-permissions) for bit flags) |
-| `recording_consent` | int | `0` | Yes | 🖌️ | Whether users have to agree on being recorded before they can join the call (see [constants](constants.md#recording-consent-required)) |
+| `recording_consent` | int | `0` | Yes | 🖌️ | Whether users have to agree on being recorded before they can join the call (see [constants](constants.md#recording-consent-required)) |
| `grid_videos_limit` | int | `19` | No | | Maximum number of videos to show (additional to the own video) |
| `sip_dialin_default` | int | `0` | No | | Default value of SIP dial-in when creating new conversations |
| `retention_event_rooms` | int | `28` | No | | Retention period of event conversations in days (`0` means no-retention) |
| `retention_phone_rooms` | int | `7` | No | | Retention period of phone dial-in and dial-out conversations in days (`0` means no-retention) |
| `retention_instant_meetings` | int | `1` | No | | Retention period of instant meetings in days (`0` means no-retention) |
-| `retention_classified_rooms` | int | `3600` | No | | Retention period of classified conversations in seconds after a call happened (`0` means no-retention) |
+| `retention_classified_rooms` | int | `3600` | No | | Retention period of classified conversations in seconds after a call happened (`0` means no-retention) |
| `experiments_users` | int | `0` | Yes | | Bit flag of experiments that should be enabled for logged-in users on this server (see [Experiments](#experiments) below) |
| `experiments_guests` | int | `0` | Yes | | Bit flag of experiments that should be enabled for guests on this server (see [Experiments](#experiments) below) |
| `summary_threshold` | int | `100` | No | | Amount of unread messages a user needs before they see the option to summarize with AI |
-| `feature_hints_hidden` | int | `0` | Yes | 🖌️ | Feature hints that should be hidden. Set to `999999` to hide all. |
+| `feature_hints_hidden` | int | `0` | Yes | 🖌️ | Feature hints that should be hidden. Set to `999999` to hide all. |
| `certificate_expiration_days` | int | `10` | No | | Minimum days a certificate needs to be valid for, before ae expiration notification will be shown. (default 10, minimum 0 and maximum 365) |
| `grid_videos_limit_enforced` | bool | `false` | No | | Whether the number of grid videos should be enforced |
| `changelog` | string
`yes` or `no` | `yes` | No | | Whether the changelog conversation is updated with new features on major releases |
-| `hide_signaling_warning` | string
`yes` or `no` | `no` | No | 🖌️ | Flag that allows to suppress the warning that an HPB should be configured |
+| `hide_signaling_warning` | string
`yes` or `no` | `no` | No | 🖌️ | Flag that allows to suppress the warning that an HPB should be configured |
| `conversations_list_style` | string
`two-lines` or `compact` | `two-lines` | No | | Default conversation list style when not overwritten by the user |
| `chat_style` | string
`split` or `unified` | `split` | No | | Default chat style when not overwritten by the user |
| `calls_start_without_media` | bool | `false` | No | | Whether participants start with enabled or disabled audio and video by default |
| `breakout_rooms` | bool | `true` | Yes | | Whether or not breakout rooms are allowed (Will only prevent creating new breakout rooms. Existing conversations are not modified.) |
| `call_recording` | string
`yes` or `no` | `yes` | Yes | | Enable call recording |
-| `call_recording_summary` | string
`yes` or `no` | `yes` | No | 🖌️ | Whether call recordings should automatically be summarized when a transcription and summary provider is enabled. |
+| `call_recording_summary` | string
`yes` or `no` | `yes` | No | 🖌️ | Whether call recordings should automatically be summarized when a transcription and summary provider is enabled. |
| `call_recording_transcription` | string
`yes` or `no` | `no` | No | | Whether call recordings should automatically be transcribed when a transcription provider is enabled. |
| `sip_dialout` | string
`yes` or `no` | `no` | Yes | | SIP dial-out is allowed when a SIP bridge is configured |
| `federation_enabled` | bool | `false` | Yes | | 🏗️ *Work in progress:* Whether or not federation with this instance is allowed |
| `federation_incoming_enabled` | string
`1` or `0` | `1` | Yes | | 🏗️ *Work in progress:* Whether users of this instance can be invited to federated conversations |
| `federation_outgoing_enabled` | string
`1` or `0` | `1` | Yes | | 🏗️ *Work in progress:* Whether users of this instance can invite federated users into conversations |
| `federation_only_trusted_servers` | string
`1` or `0` | `0` | Yes | | 🏗️ *Work in progress:* Whether federation should be limited to the list of "Trusted servers" |
-| `federation_allowed_groups` | string[] | `[]` | Yes | 🖌️ | List of local group ids that are allowed to use federated features |
-| `conversations_files` | string
`1` or `0` | `1` | No | 🖌️ | Whether the files app integration is enabled allowing to start conversations in the right sidebar |
-| `conversations_files_public_shares` | string
`1` or `0` | `1` | No | 🖌️ | Whether the public share integration is enabled allowing to start conversations in the right sidebar on the public share page (Requires `conversations_files` also to be enabled) |
-| `delete_one_to_one_conversations` | string
`1` or `0` | `0` | No | ️ | Whether one-to-one conversations can be left by either participant or should be deleted when one participant leaves |
-| `enable_matterbridge` | string
`1` or `0` | `0` | No | 🖌️ | Whether the Matterbridge integration is enabled and can be configured |
-| `force_passwords` | bool | `false` | No | ️ | Whether public chats are forced to use a password |
-| `create_samples` | string
`1` or `0` | `1` | No | ️ | Create sample conversations (the content can be overwritten by providing files in a provided `samples_directory` app config) |
-| `call_end_to_end_encryption` | bool | `false` | No | 🖌️ | Whether clients should end-to-end encrypt streams in calls (Only supported with High-performance backend) |
+| `federation_allowed_groups` | string[] | `[]` | Yes | 🖌️ | List of local group ids that are allowed to use federated features |
+| `conversations_files` | bool | `true` | No | 🖌️ | Whether the files app integration is enabled allowing to start conversations in the right sidebar |
+| `conversations_files_public_shares` | bool | `true` | No | 🖌️ | Whether the public share integration is enabled allowing to start conversations in the right sidebar on the public share page (Requires `conversations_files` also to be enabled) |
+| `delete_one_to_one_conversations` | bool | `false` | No | ️ | Whether one-to-one conversations can be left by either participant or should be deleted when one participant leaves |
+| `enable_matterbridge` | bool | `false` | No | 🖌️ | Whether the Matterbridge integration is enabled and can be configured |
+| `force_passwords` | bool | `false` | No | ️ | Whether public chats are forced to use a password |
+| `create_samples` | bool | `true` | No | ️ | Create sample conversations (the content can be overwritten by providing files in a provided `samples_directory` app config) |
+| `call_end_to_end_encryption` | bool | `false` | No | 🖌️ | Whether clients should end-to-end encrypt streams in calls (Only supported with High-performance backend) |
| `inactivity_lock_after_days` | int | `0` | No | | A duration (in days) after which rooms are locked. Calculated from the last activity in the room. |
| `inactivity_enable_lobby` | bool | `false` | No | | Additionally enable the lobby for inactive rooms so they can only be read by moderators. |
-| `backgrounds_branded_for_guests` | string
`1` or `0` | `0` | No | | Whether guests are allowed to use the virtual backgrounds provided via `themes/talk-backgrounds/` |
-| `backgrounds_default_for_users` | string
`1` or `0` | `1` | No | | Whether users are allowed to use the default virtual backgrounds provided by the releases |
-| `backgrounds_upload_users` | string
`1` or `0` | `1` | No | | Whether users are allowed to upload custom virtual backgrounds and choose from their Nextcloud Files |
+| `backgrounds_branded_for_guests` | bool | `false` | No | | Whether guests are allowed to use the virtual backgrounds provided via `themes/talk-backgrounds/` |
+| `backgrounds_default_for_users` | bool | `true` | No | | Whether users are allowed to use the default virtual backgrounds provided by the releases |
+| `backgrounds_upload_users` | bool | `true` | No | | Whether users are allowed to upload custom virtual backgrounds and choose from their Nextcloud Files |
| `guests_play_sounds` | bool | `true` | No | | Whether guests hear the join and leave sounds by default |
## Experiments
diff --git a/lib/BackgroundJob/CheckMatterbridges.php b/lib/BackgroundJob/CheckMatterbridges.php
index d574ff21238..47e595f85ae 100644
--- a/lib/BackgroundJob/CheckMatterbridges.php
+++ b/lib/BackgroundJob/CheckMatterbridges.php
@@ -8,7 +8,9 @@
namespace OCA\Talk\BackgroundJob;
+use OCA\Talk\Config;
use OCA\Talk\MatterbridgeManager;
+use OCP\AppFramework\Services\IAppConfig;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\BackgroundJob\IJob;
use OCP\BackgroundJob\TimedJob;
@@ -25,6 +27,7 @@ class CheckMatterbridges extends TimedJob {
public function __construct(
ITimeFactory $time,
private readonly IConfig $serverConfig,
+ private readonly IAppConfig $appConfig,
private readonly MatterbridgeManager $bridgeManager,
private readonly LoggerInterface $logger,
) {
@@ -38,7 +41,7 @@ public function __construct(
#[\Override]
protected function run($argument): void {
- if ($this->serverConfig->getAppValue('spreed', 'enable_matterbridge', '0') === '1') {
+ if ($this->appConfig->getAppValueBool(Config::MATTERBRIDGE_ENABLED)) {
$this->bridgeManager->checkAllBridges();
$this->bridgeManager->killZombieBridges();
$this->logger->info('Checked if Matterbridge instances are running correctly.');
diff --git a/lib/Config.php b/lib/Config.php
index e02cd88fdc0..045fe78d8fd 100644
--- a/lib/Config.php
+++ b/lib/Config.php
@@ -48,6 +48,8 @@ class Config {
public const string ALLOWED_GROUPS_CONVERSATIONS = 'start_conversations';
public const string BREAKOUT_ROOMS_ENABLED = 'breakout_rooms';
public const string CONVERSATION_SUBFOLDERS = 'conversation_subfolders';
+ public const string CONVERSATIONS_FILES = 'conversations_files';
+ public const string CONVERSATIONS_FILES_PUBLIC_SHARES = 'conversations_files_public_shares';
public const string DEFAULT_ROOM_PERMISSIONS = 'default_permissions';
public const string DEFAULT_ATTACHMENT_FOLDER = 'default_attachment_folder';
public const string GRID_VIDEOS_LIMIT = 'grid_videos_limit';
@@ -66,6 +68,13 @@ class Config {
public const string EXPERIMENTS_USERS = 'experiments_users';
public const string EXPERIMENTS_GUESTS = 'experiments_guests';
public const string CALL_END_TO_END_ENCRYPTION = 'call_end_to_end_encryption';
+ public const string FORCE_PASSWORDS = 'force_passwords';
+ public const string BACKGROUNDS_BRANDED_FOR_GUESTS = 'backgrounds_branded_for_guests';
+ public const string BACKGROUNDS_DEFAULT_FOR_USERS = 'backgrounds_default_for_useres';
+ public const string BACKGROUNDS_UPLOAD_USERS = 'backgrounds_upload_users';
+ public const string CREATE_SAMPLES = 'create_samples';
+ public const string MATTERBRIDGE_ENABLED = 'enable_matterbridge';
+ public const string DELETE_ONE_TO_ONE_CONVERSATIONS = 'delete_one_to_one_conversations';
/**
* 1. Call recording, …
@@ -1019,7 +1028,7 @@ public function hasExperiment(int $experiment): bool {
}
public function isPasswordEnforced(): bool {
- return $this->appConfig->getAppValueBool('force_passwords');
+ return $this->appConfig->getAppValueBool(self::FORCE_PASSWORDS);
}
public function isCallEndToEndEncryptionEnabled(): bool {
@@ -1039,6 +1048,6 @@ public function getPlaySoundsForUser(?IUser $user): bool {
}
public function getPlaySoundsDefaultForGuests(): bool {
- return $this->appConfig->getAppValueBool('guests_play_sounds', true);
+ return $this->appConfig->getAppValueBool(self::GUESTS_PLAY_SOUNDS);
}
}
diff --git a/lib/ConfigLexicon.php b/lib/ConfigLexicon.php
index e452e683930..04b5cb5e5ed 100644
--- a/lib/ConfigLexicon.php
+++ b/lib/ConfigLexicon.php
@@ -37,6 +37,8 @@ public function getAppConfigs(): array {
new Entry(Config::ALLOWED_GROUPS_CONVERSATIONS, ValueType::ARRAY, [], definition: 'List of group ids that are allowed to create conversation'),
new Entry(Config::BREAKOUT_ROOMS_ENABLED, ValueType::BOOL, true, definition: 'Whether or not breakout rooms are allowed (Will only prevent creating new breakout rooms. Existing conversations are not modified.'),
new Entry(Config::CONVERSATION_SUBFOLDERS, ValueType::BOOL, true, definition: ''),
+ new Entry(Config::CONVERSATIONS_FILES, ValueType::BOOL, true, definition: 'Whether the files app integration is enabled allowing tostart conversations in the right sidebar'),
+ new Entry(Config::CONVERSATIONS_FILES_PUBLIC_SHARES, ValueType::BOOL, true, definition: 'Whether the public share integration is enabled allowing to start conversations in the right sidebar on the public share page (Requires `conversations_files` also to be enabled'),
new Entry(Config::DEFAULT_ROOM_PERMISSIONS, ValueType::INT, 246, definition: 'Default permissions for non-moderators' . PHP_EOL . '(see https://github.com/nextcloud/spreed/blob/main/docs/constants.md#attendee-permissions for bit flags)'),
new Entry(Config::DEFAULT_ATTACHMENT_FOLDER, ValueType::STRING, '/Talk', definition: 'Specify default attachment folder location'),
new Entry(Config::GRID_VIDEOS_LIMIT, ValueType::INT, 19 /* 5*4 - self */, definition: 'Maximum number of videos to show (additional to the own video)'),
@@ -50,11 +52,18 @@ public function getAppConfigs(): array {
new Entry(Config::EXTERNAL_CALL_SERVICE_FRAME_ORIGINS, ValueType::ARRAY, [], definition: 'JSON array of scheme+host(+port) origins that may be loaded in the iframe.' . PHP_EOL . 'Added to `Content-Security-Policy: frame-src` and the `Permissions-Policy` for camera/microphone'),
new Entry(Config::EXTERNAL_CALL_SERVICE_IFRAME_FIELD, ValueType::STRING, '', definition: 'JSON field name in the external service response that contains the iframe URL'),
new Entry(Config::CALLS_START_WITHOUT_MEDIA, ValueType::BOOL, false, definition: 'Whether participants start with enabled or disabled audio and video by default'),
- new Entry(Config::INACTIVITY_LOCK_AFTER_DAYS, ValueType::INT, 0, definition: 'A duration (in days) after which rooms are locked. Calculated from the last activity in the room,'),
+ new Entry(Config::INACTIVITY_LOCK_AFTER_DAYS, ValueType::INT, 0, definition: 'A duration (in days) after which rooms are locked. Calculated from the last activity in the room.'),
new Entry(Config::INACTIVITY_ENABLE_LOBBY, ValueType::BOOL, false, definition: 'Additionally enable the lobby for inactive rooms so they can only be read by moderators.'),
new Entry(Config::EXPERIMENTS_USERS, ValueType::INT, 0, definition: 'Bit flag of experiments that should be enabled for logged-in users on this server' . PHP_EOL . 'See https://github.com/nextcloud/spreed/blob/main/docs/settings.md#experiments'),
new Entry(Config::EXPERIMENTS_GUESTS, ValueType::INT, 0, definition: 'Bit flag of experiments that should be enabled for guests on this server' . PHP_EOL . 'See https://github.com/nextcloud/spreed/blob/main/docs/settings.md#experiments'),
new Entry(Config::CALL_END_TO_END_ENCRYPTION, ValueType::BOOL, false, definition: 'Whether clients should end-to-end encrypt streams in calls (Only supported with High-performance backend'),
+ new Entry(Config::FORCE_PASSWORDS, ValueType::BOOL, false, definition: 'Whether public chats are forced to use a password'),
+ new Entry(Config::BACKGROUNDS_BRANDED_FOR_GUESTS, ValueType::BOOL, false, definition: 'Whether guests are allowed to use the virtual backgrounds provided via `themes/talk-backgrounds/`'),
+ new Entry(Config::BACKGROUNDS_DEFAULT_FOR_USERS, ValueType::BOOL, definition: 'Whether users are allowed to use the default virutal backgrounds provided by the releases'),
+ new Entry(Config::BACKGROUNDS_UPLOAD_USERS, ValueType::BOOL, definition: 'Whether users are allowed to upload custom virtual backgrounds and choose from their Nextcloud Files'),
+ new Entry(Config::CREATE_SAMPLES, ValueType::BOOL, true, definition: 'Create sample conversations (the content can be overwritten by providing files in a provided `samples_directory` app config)'),
+ new Entry(Config::MATTERBRIDGE_ENABLED, ValueType::BOOL, false, definition: 'Whether the Matterbridge integration is enabled and can be configured'),
+ new Entry(Config::DELETE_ONE_TO_ONE_CONVERSATIONS, ValueType::BOOL, false, definition: 'Whether one-to-one conversations can be left by either participant or should be deleted when one participant leaves'),
];
}
diff --git a/lib/Controller/ChatController.php b/lib/Controller/ChatController.php
index 091ae322f69..77ae2436981 100644
--- a/lib/Controller/ChatController.php
+++ b/lib/Controller/ChatController.php
@@ -1860,7 +1860,7 @@ public function clearHistory(): DataResponse {
return new DataResponse(null, Http::STATUS_FORBIDDEN);
}
- if (!$this->appConfig->getAppValueBool('delete_one_to_one_conversations')
+ if (!$this->appConfig->getAppValueBool(Config::DELETE_ONE_TO_ONE_CONVERSATIONS)
&& ($this->room->getType() === Room::TYPE_ONE_TO_ONE
|| $this->room->getType() === Room::TYPE_ONE_TO_ONE_FORMER)) {
// Not allowed to purge one-to-one conversations
diff --git a/lib/Controller/FilesIntegrationController.php b/lib/Controller/FilesIntegrationController.php
index 5a953667a1d..90e8fa3c738 100644
--- a/lib/Controller/FilesIntegrationController.php
+++ b/lib/Controller/FilesIntegrationController.php
@@ -8,6 +8,7 @@
namespace OCA\Talk\Controller;
+use OCA\Talk\Config;
use OCA\Talk\Exceptions\RoomNotFoundException;
use OCA\Talk\Files\Util;
use OCA\Talk\Manager;
@@ -24,6 +25,7 @@
use OCP\AppFramework\OCS\OCSException;
use OCP\AppFramework\OCS\OCSNotFoundException;
use OCP\AppFramework\OCSController;
+use OCP\AppFramework\Services\IAppConfig;
use OCP\Files\FileInfo;
use OCP\Files\NotFoundException;
use OCP\IConfig;
@@ -48,6 +50,7 @@ public function __construct(
private readonly TalkSession $talkSession,
private readonly Util $util,
private readonly IConfig $config,
+ private readonly IAppConfig $appConfig,
private readonly IL10N $l,
) {
parent::__construct($appName, $request);
@@ -89,7 +92,7 @@ public function __construct(
'fileId' => '.+',
])]
public function getRoomByFileId(string $fileId): DataResponse {
- if ($this->config->getAppValue('spreed', 'conversations_files', '1') !== '1') {
+ if (!$this->appConfig->getAppValueBool(Config::CONVERSATIONS_FILES)) {
return new DataResponse(null, Http::STATUS_BAD_REQUEST);
}
@@ -167,8 +170,8 @@ public function getRoomByFileId(string $fileId): DataResponse {
'shareToken' => '.+',
])]
public function getRoomByShareToken(string $shareToken): DataResponse {
- if ($this->config->getAppValue('spreed', 'conversations_files', '1') !== '1'
- || $this->config->getAppValue('spreed', 'conversations_files_public_shares', '1') !== '1') {
+ if (!$this->appConfig->getAppValueBool(Config::CONVERSATIONS_FILES)
+ || !$this->appConfig->getAppValueBool(Config::CONVERSATIONS_FILES_PUBLIC_SHARES)) {
return new DataResponse(null, Http::STATUS_BAD_REQUEST);
}
diff --git a/lib/Controller/RoomController.php b/lib/Controller/RoomController.php
index 9250034f2f8..977e20596f9 100644
--- a/lib/Controller/RoomController.php
+++ b/lib/Controller/RoomController.php
@@ -196,8 +196,8 @@ protected function getTalkHashHeader(): array {
$this->appConfig->getAppValueInt(Config::DEFAULT_ROOM_PERMISSIONS),
$this->appConfig->getAppValueBool(Config::BREAKOUT_ROOMS_ENABLED),
$this->config->getAppValue('spreed', 'federation_enabled'),
- $this->config->getAppValue('spreed', 'enable_matterbridge'),
json_encode($this->appConfig->getAppValueArray(Config::ALLOWED_GROUPS_SIP)),
+ $this->appConfig->getAppValueBool(Config::MATTERBRIDGE_ENABLED),
$this->config->getAppValue('spreed', 'sip_bridge_dialin_info'),
$this->config->getAppValue('spreed', 'sip_bridge_shared_secret'),
$this->config->getAppValue('spreed', 'recording_consent'),
@@ -1132,7 +1132,7 @@ public function deleteRoom(): DataResponse {
return new DataResponse(['error' => 'preserved'], Http::STATUS_FORBIDDEN);
}
- if (!$this->appConfig->getAppValueBool('delete_one_to_one_conversations')
+ if (!$this->appConfig->getAppValueBool(Config::DELETE_ONE_TO_ONE_CONVERSATIONS)
&& in_array($this->room->getType(), [Room::TYPE_ONE_TO_ONE, Room::TYPE_ONE_TO_ONE_FORMER], true)) {
return new DataResponse(null, Http::STATUS_BAD_REQUEST);
}
@@ -1734,7 +1734,7 @@ protected function removeSelfFromRoomLogic(Room $room, Participant $participant)
return new DataResponse(null);
}
- if ($this->appConfig->getAppValueBool('delete_one_to_one_conversations')
+ if ($this->appConfig->getAppValueBool(Config::DELETE_ONE_TO_ONE_CONVERSATIONS)
&& in_array($this->room->getType(), [Room::TYPE_ONE_TO_ONE, Room::TYPE_ONE_TO_ONE_FORMER], true)) {
$this->roomService->deleteRoom($room);
return new DataResponse(null);
diff --git a/lib/Files/TemplateLoader.php b/lib/Files/TemplateLoader.php
index 482cba06f7f..b18a32b07c6 100644
--- a/lib/Files/TemplateLoader.php
+++ b/lib/Files/TemplateLoader.php
@@ -11,6 +11,7 @@
use OCA\Files\Event\LoadSidebar;
use OCA\Talk\AppInfo\Application;
use OCA\Talk\Config;
+use OCP\AppFramework\Services\IAppConfig;
use OCP\AppFramework\Services\IInitialState;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
@@ -30,6 +31,7 @@ public function __construct(
private readonly IInitialState $initialState,
private readonly Config $talkConfig,
private readonly IConfig $serverConfig,
+ private readonly IAppConfig $appConfig,
private readonly IUserSession $userSession,
private readonly IRequest $request,
) {
@@ -49,7 +51,7 @@ public function handle(Event $event): void {
return;
}
- if ($this->serverConfig->getAppValue('spreed', 'conversations_files', '1') !== '1') {
+ if (!$this->appConfig->getAppValueBool(Config::CONVERSATIONS_FILES)) {
return;
}
diff --git a/lib/PublicShare/TemplateLoader.php b/lib/PublicShare/TemplateLoader.php
index c229fca8d3e..9127397abbe 100644
--- a/lib/PublicShare/TemplateLoader.php
+++ b/lib/PublicShare/TemplateLoader.php
@@ -12,6 +12,7 @@
use OCA\Files_Sharing\Event\BeforeTemplateRenderedEvent;
use OCA\Talk\AppInfo\Application;
use OCA\Talk\Config;
+use OCP\AppFramework\Services\IAppConfig;
use OCP\AppFramework\Services\IInitialState;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
@@ -31,6 +32,7 @@ public function __construct(
private readonly IInitialState $initialState,
private readonly Config $talkConfig,
private readonly IConfig $serverConfig,
+ private readonly IAppConfig $appConfig,
) {
}
@@ -49,8 +51,8 @@ public function handle(Event $event): void {
return;
}
- if ($this->serverConfig->getAppValue('spreed', 'conversations_files', '1') !== '1'
- || $this->serverConfig->getAppValue('spreed', 'conversations_files_public_shares', '1') !== '1') {
+ if (!$this->appConfig->getAppValueBool(Config::CONVERSATIONS_FILES)
+ || !$this->appConfig->getAppValueBool(Config::CONVERSATIONS_FILES_PUBLIC_SHARES)) {
return;
}
diff --git a/lib/Service/SampleConversationsService.php b/lib/Service/SampleConversationsService.php
index c0fd5481d4d..5374dbc10ae 100644
--- a/lib/Service/SampleConversationsService.php
+++ b/lib/Service/SampleConversationsService.php
@@ -10,6 +10,7 @@
use OCA\Talk\Chat\ChatManager;
use OCA\Talk\Chat\ReactionManager;
+use OCA\Talk\Config;
use OCA\Talk\Model\Attendee;
use OCA\Talk\Room;
use OCP\AppFramework\Services\IAppConfig;
@@ -44,7 +45,7 @@ public function __construct(
}
public function initialCreateSamples(string $userId): void {
- if (!$this->appConfig->getAppValueBool('create_samples', true)) {
+ if (!$this->appConfig->getAppValueBool(Config::CREATE_SAMPLES, true)) {
return;
}
diff --git a/lib/Settings/Admin/AdminSettings.php b/lib/Settings/Admin/AdminSettings.php
index 92487c9cf9e..d4dc099bc31 100644
--- a/lib/Settings/Admin/AdminSettings.php
+++ b/lib/Settings/Admin/AdminSettings.php
@@ -71,8 +71,8 @@ public function getForm(): TemplateResponse {
protected function initGeneralSettings(): void {
$this->initialState->provideInitialState('default_group_notification', (int)$this->serverConfig->getAppValue('spreed', 'default_group_notification', (string)Participant::NOTIFY_ALWAYS));
- $this->initialState->provideInitialState('conversations_files', (int)$this->serverConfig->getAppValue('spreed', 'conversations_files', '1'));
- $this->initialState->provideInitialState('conversations_files_public_shares', (int)$this->serverConfig->getAppValue('spreed', 'conversations_files_public_shares', '1'));
+ $this->initialState->provideInitialState(Config::CONVERSATIONS_FILES, (int)$this->appConfig->getAppValueBool(Config::CONVERSATIONS_FILES));
+ $this->initialState->provideInitialState(Config::CONVERSATIONS_FILES_PUBLIC_SHARES, (int)$this->appConfig->getAppValueBool(Config::CONVERSATIONS_FILES_PUBLIC_SHARES));
$this->initialState->provideInitialState('valid_apache_php_configuration', $this->validApachePHPConfiguration());
}
@@ -117,7 +117,7 @@ protected function initMatterbridge(): void {
$this->initialState->provideInitialState(
'matterbridge_enable',
- $this->serverConfig->getAppValue('spreed', 'enable_matterbridge', '0') === '1'
+ $this->appConfig->getAppValueBool(Config::MATTERBRIDGE_ENABLED)
);
}
diff --git a/tests/integration/features/chat-1/delete.feature b/tests/integration/features/chat-1/delete.feature
index 6bb677d0f08..79ec768149c 100644
--- a/tests/integration/features/chat-1/delete.feature
+++ b/tests/integration/features/chat-1/delete.feature
@@ -273,5 +273,5 @@ Feature: chat-1/delete
And user "participant1" sends message "Message" to room "room" with 201
Then user "participant1" deletes chat history for room "room" with 403
When the following "spreed" app config is set
- | delete_one_to_one_conversations | 1 |
+ | delete_one_to_one_conversations | true |
Then user "participant1" deletes chat history for room "room" with 200
diff --git a/tests/integration/features/conversation-3/one-to-one.feature b/tests/integration/features/conversation-3/one-to-one.feature
index 531ba2a5124..dc0949e2610 100644
--- a/tests/integration/features/conversation-3/one-to-one.feature
+++ b/tests/integration/features/conversation-3/one-to-one.feature
@@ -236,7 +236,7 @@ Feature: conversation-3/one-to-one
| roomType | 1 |
| invite | participant2 |
And the following "spreed" app config is set
- | delete_one_to_one_conversations | 1 |
+ | delete_one_to_one_conversations | true |
Then user "participant1" removes themselves from room "room" with 200 (v4)
And user "participant1" is participant of the following rooms (v4)
And user "participant2" is participant of the following rooms (v4)
@@ -248,7 +248,7 @@ Feature: conversation-3/one-to-one
And user "participant1" sends message "Message" to room "room" with 201
Then user "participant1" deletes room "room" with 400 (v4)
When the following "spreed" app config is set
- | delete_one_to_one_conversations | 1 |
+ | delete_one_to_one_conversations | true |
Then user "participant1" deletes room "room" with 200 (v4)
And user "participant1" is participant of the following rooms (v4)
And user "participant2" is participant of the following rooms (v4)