Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/developer-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ The provided `docker-compose.yml` file from `nextcloud-docker-dev` supports spin

6. Enable federation in the admin settings of Nextcloud Talk or alternatively via occ:

./scripts/occ.sh nextcloud -- config:app:set spreed federation_enabled --value yes
./scripts/occ.sh nextcloud2 -- config:app:set spreed federation_enabled --value yes
./scripts/occ.sh nextcloud -- config:app:set spreed federation_enabled --value true --type boolean
./scripts/occ.sh nextcloud2 -- config:app:set spreed federation_enabled --value true --type boolean

### Rebuild / update Talk after code changes

Expand Down
10 changes: 5 additions & 5 deletions docs/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,18 +120,18 @@ Legend:
| `hide_signaling_warning` | bool | `false` | No | πŸ–ŒοΈ | Flag that allows to suppress the warning that an HPB should be configured |
| `conversations_list_style` | string<br>`two-lines` or `compact` | `two-lines` | No | | Default conversation list style when not overwritten by the user |
| `chat_style` | string<br>`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 |
| `calls_start_without_media` | bool | `false` | Yes | | 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` | bool | `true` | Yes | | Enable call recording |
| `call_recording_summary` | bool | `true` | No | πŸ–ŒοΈ | Whether call recordings should automatically be summarized when a transcription and summary provider is enabled. |
| `call_recording_transcription` | bool | `false` | Yes | | Whether call recordings should automatically be transcribed when a transcription provider is enabled. |
| `call_recording_summary_prompt` | string | `''` | No | | Instructions used by LLM to generate Talk call recording summaries |
| `sip_bridge_dialout` | bool | `false` | 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<br>`1` or `0` | `1` | Yes | | πŸ—οΈ *Work in progress:* Whether users of this instance can be invited to federated conversations |
| `federation_outgoing_enabled` | string<br>`1` or `0` | `1` | Yes | | πŸ—οΈ *Work in progress:* Whether users of this instance can invite federated users into conversations |
| `federation_only_trusted_servers` | string<br>`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 |
| `federation_incoming_enabled` | bool | `true` | Yes | | πŸ—οΈ *Work in progress:* Whether users of this instance can be invited to federated conversations |
| `federation_outgoing_enabled` | bool | `true` | Yes | | πŸ—οΈ *Work in progress:* Whether users of this instance can invite federated users into conversations |
| `federation_only_trusted_servers` | bool | `false` | Yes | | πŸ—οΈ *Work in progress:* Whether federation should be limited to the list of "Trusted servers" |
| `federation_allowed_groups` | array | `[]` | 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 |
Expand Down
7 changes: 4 additions & 3 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
use OCA\Talk\Collaboration\Reference\TalkReferenceProvider;
use OCA\Talk\Collaboration\Resources\ConversationProvider;
use OCA\Talk\Collaboration\Resources\Listener as ResourceListener;
use OCA\Talk\Config;
use OCA\Talk\ConfigLexicon;
use OCA\Talk\Dashboard\TalkWidget;
use OCA\Talk\Deck\DeckPluginLoader;
Expand Down Expand Up @@ -142,6 +143,7 @@
use OCP\AppFramework\Bootstrap\IBootContext;
use OCP\AppFramework\Bootstrap\IBootstrap;
use OCP\AppFramework\Bootstrap\IRegistrationContext;
use OCP\AppFramework\Services\IAppConfig;
use OCP\Calendar\Events\CalendarObjectCreatedEvent;
use OCP\Calendar\Events\CalendarObjectUpdatedEvent;
use OCP\Collaboration\AutoComplete\AutoCompleteFilterEvent;
Expand All @@ -158,7 +160,6 @@
use OCP\Group\Events\GroupDeletedEvent;
use OCP\Group\Events\UserAddedEvent;
use OCP\Group\Events\UserRemovedEvent;
use OCP\IConfig;
use OCP\Navigation\Events\LoadAdditionalEntriesEvent;
use OCP\OCM\Events\ResourceTypeRegisterEvent;
use OCP\Security\CSP\AddContentSecurityPolicyEvent;
Expand Down Expand Up @@ -440,10 +441,10 @@ public function registerClientLinks(IAppManager $appManager, IManager $settingMa
}

public function registerCloudFederationProviderManager(
IConfig $config,
IAppConfig $appConfig,
ICloudFederationProviderManager $manager,
): void {
if ($config->getAppValue('spreed', 'federation_enabled', 'no') !== 'yes') {
if (!$appConfig->getAppValueBool(Config::FEDERATION_ENABLED)) {
return;
}

Expand Down
14 changes: 7 additions & 7 deletions lib/Capabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ public function getCapabilities(): array {
'enabled' => $user instanceof IUser && $this->talkConfig->isMatrixEnabled(),
],
'previews' => [
'max-gif-size' => $this->appConfig->getAppValueInt(Config::MAX_GIF_SIZE, 3145728),
'max-gif-size' => $this->appConfig->getAppValueInt(Config::MAX_GIF_SIZE),
],
'signaling' => [
'session-ping-limit' => max(0, $this->appConfig->getAppValueInt(Config::SESSION_PING_LIMIT)),
Expand Down Expand Up @@ -377,9 +377,9 @@ public function getCapabilities(): array {
if ($this->talkConfig->isFederationEnabled() && $this->talkConfig->isFederationEnabledForUserId($user)) {
$capabilities['config']['federation'] = [
'enabled' => true,
'incoming-enabled' => $this->appConfig->getAppValueBool('federation_incoming_enabled', true),
'outgoing-enabled' => $this->appConfig->getAppValueBool('federation_outgoing_enabled', true),
'only-trusted-servers' => $this->appConfig->getAppValueBool('federation_only_trusted_servers'),
'incoming-enabled' => $this->appConfig->getAppValueBool(Config::FEDERATION_INCOMING_ENABLED),
'outgoing-enabled' => $this->appConfig->getAppValueBool(Config::FEDERATION_OUTGOING_ENABLED),
'only-trusted-servers' => $this->appConfig->getAppValueBool(Config::FEDERATION_ONLY_TRUSTED_SERVERS),
];
}

Expand All @@ -394,8 +394,8 @@ public function getCapabilities(): array {
$capabilities['config']['signaling']['hello-v2-token-key'] = $pubKey;
}

$includeBrandedBackgrounds = $user instanceof IUser || $this->appConfig->getAppValueBool('backgrounds_branded_for_guests');
$includeDefaultBackgrounds = !$user instanceof IUser || $this->appConfig->getAppValueBool('backgrounds_default_for_users', true);
$includeBrandedBackgrounds = $user instanceof IUser || $this->appConfig->getAppValueBool(Config::BACKGROUNDS_BRANDED_FOR_GUESTS);
$includeDefaultBackgrounds = !$user instanceof IUser || $this->appConfig->getAppValueBool(Config::BACKGROUNDS_DEFAULT_FOR_USERS);

$predefinedBackgrounds = [];
$defaultBackgrounds = $this->getBackgroundsFromDirectory(__DIR__ . '/../img/backgrounds', '_default');
Expand All @@ -414,7 +414,7 @@ public function getCapabilities(): array {
$capabilities['config']['call']['predefined-backgrounds-v2'] = array_values($predefinedBackgrounds);

if ($user instanceof IUser) {
$userAllowedToUpload = $this->appConfig->getAppValueBool('backgrounds_upload_users', true);
$userAllowedToUpload = $this->appConfig->getAppValueBool(Config::BACKGROUNDS_UPLOAD_USERS);
if ($userAllowedToUpload) {
$quota = $user->getQuota();
if ($quota !== 'none') {
Expand Down
11 changes: 8 additions & 3 deletions lib/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ class Config {
public const string ALLOWED_GROUPS_TALK = 'allowed_groups';
public const string ALLOWED_GROUPS_SIP = 'sip_bridge_groups';
public const string ALLOWED_GROUPS_CONVERSATIONS = 'start_conversations';
public const string ALLOWED_GROUPS_FEDERATION = 'federation_allowed_groups';
public const string FEDERATION_ENABLED = 'federation_enabled';
public const string FEDERATION_INCOMING_ENABLED = 'federation_incoming_enabled';
public const string FEDERATION_OUTGOING_ENABLED = 'federation_outgoing_enabled';
public const string FEDERATION_ONLY_TRUSTED_SERVERS = 'federation_only_trusted_servers';
public const string BREAKOUT_ROOMS_ENABLED = 'breakout_rooms';
public const string CONVERSATION_SUBFOLDERS = 'conversation_subfolders';
public const string CONVERSATIONS_FILES = 'conversations_files';
Expand Down Expand Up @@ -77,7 +82,7 @@ class Config {
public const string RECORDING_SERVERS = 'recording_servers';
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_DEFAULT_FOR_USERS = 'backgrounds_default_for_users';
public const string BACKGROUNDS_UPLOAD_USERS = 'backgrounds_upload_users';
public const string CREATE_SAMPLES = 'create_samples';
public const string MATTERBRIDGE_ENABLED = 'enable_matterbridge';
Expand Down Expand Up @@ -192,11 +197,11 @@ public function isSIPConfigured(): bool {
*/
public function isFederationEnabled(): bool {
// TODO: Set to default true once implementation is complete
return $this->config->getAppValue('spreed', 'federation_enabled', 'no') === 'yes';
return $this->appConfig->getAppValueBool(self::FEDERATION_ENABLED);
}

public function isFederationEnabledForUserId(IUser $user): bool {
$allowedGroups = $this->appConfig->getAppValueArray('federation_allowed_groups', lazy: true);
$allowedGroups = $this->appConfig->getAppValueArray(self::ALLOWED_GROUPS_FEDERATION, lazy: true);
if (empty($allowedGroups)) {
return true;
}
Expand Down
7 changes: 6 additions & 1 deletion lib/ConfigLexicon.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,16 @@ public function getAppConfigs(): array {
new Entry(Config::ALLOWED_GROUPS_TALK, ValueType::ARRAY, [], definition: 'List of group ids that are allowed to use Talk'),
new Entry(Config::ALLOWED_GROUPS_SIP, ValueType::ARRAY, [], definition: 'List of group ids that are allowed to enable SIP dial-in in a conversation'),
new Entry(Config::ALLOWED_GROUPS_CONVERSATIONS, ValueType::ARRAY, [], definition: 'List of group ids that are allowed to create conversation'),
new Entry(Config::ALLOWED_GROUPS_FEDERATION, ValueType::ARRAY, [], definition: 'List of local group ids that are allowed to use federated features'),
new Entry(Config::FEDERATION_ENABLED, ValueType::BOOL, false, definition: 'Whether or not federation with this instance is allowed'),
new Entry(Config::FEDERATION_INCOMING_ENABLED, ValueType::BOOL, true, definition: 'Whether users of this instance can be invited to federated conversations'),
new Entry(Config::FEDERATION_OUTGOING_ENABLED, ValueType::BOOL, true, definition: 'Whether users of this instance can invite federated users into conversations'),
new Entry(Config::FEDERATION_ONLY_TRUSTED_SERVERS, ValueType::BOOL, false, definition: 'Whether federation should be limited to the list of "Trusted servers"'),
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::CONVERSATION_SUBFOLDERS, ValueType::BOOL, true, definition: ''),
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)'),
new Entry(Config::GRID_VIDEOS_LIMIT_ENFORCED, ValueType::BOOL, false, definition: 'Whether the number of grid videos should be enforced'),
Expand Down
Loading
Loading