Merge pull request #16319 from nextcloud/bugfix/noid/change-default_group_notification

fix(notifications): Change default group notifications to "Always"
This commit is contained in:
Joas Schilling 2025-11-22 13:06:16 +01:00 committed by GitHub
commit 2db4c853c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 46 additions and 5 deletions

View file

@ -97,7 +97,7 @@ Legend:
| `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 | `2` | No | 🖌️ | Default notification level for group conversations [constants list](constants.md#participant-notification-levels) |
| `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)) |
| `grid_videos_limit` | int | `19` | No | | Maximum number of videos to show (additional to the own video) |

View file

@ -658,7 +658,7 @@ class Notifier {
}
protected function getDefaultGroupNotification(): int {
return (int)$this->config->getAppValue('spreed', 'default_group_notification', (string)Participant::NOTIFY_MENTION);
return (int)$this->config->getAppValue('spreed', 'default_group_notification', (string)Participant::NOTIFY_ALWAYS);
}
/**

View file

@ -0,0 +1,39 @@
<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\Talk\Migration;
use Closure;
use OCA\Talk\Participant;
use OCP\AppFramework\Services\IAppConfig;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
use Override;
/**
* Persist the previous default for group notifications for installations on update.
*/
class Version23000Date20251114105144 extends SimpleMigrationStep {
public function __construct(
protected readonly IAppConfig $appConfig,
) {
}
#[Override]
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void {
// Persist the previous default for group notifications for installations on update.
$previous = $this->appConfig->getAppValueInt('default_group_notification', Participant::NOTIFY_DEFAULT);
if ($previous === Participant::NOTIFY_DEFAULT) {
$this->appConfig->setAppValueInt(
'default_group_notification',
Participant::NOTIFY_MENTION,
);
}
}
}

View file

@ -74,7 +74,7 @@ class FederationChatNotifier {
}
// Also notify default participants in one-to-one chats or when the admin default is "always"
$defaultLevel = $this->appConfig->getAppValueInt('default_group_notification', Participant::NOTIFY_MENTION);
$defaultLevel = $this->appConfig->getAppValueInt('default_group_notification', Participant::NOTIFY_ALWAYS);
if ($notificationLevel === Participant::NOTIFY_MENTION
|| ($defaultLevel !== Participant::NOTIFY_NEVER && $notificationLevel === Participant::NOTIFY_DEFAULT)) {
if ($this->isRepliedTo($room, $participant, $metaData)) {

View file

@ -288,7 +288,7 @@ class RoomFormatter {
} else {
$adminSetting = (int)$this->serverConfig->getAppValue('spreed', 'default_group_notification', (string)Participant::NOTIFY_DEFAULT);
if ($adminSetting === Participant::NOTIFY_DEFAULT) {
$roomData['notificationLevel'] = Participant::NOTIFY_MENTION;
$roomData['notificationLevel'] = Participant::NOTIFY_ALWAYS;
} else {
$roomData['notificationLevel'] = $adminSetting;
}

View file

@ -71,7 +71,7 @@ class AdminSettings implements ISettings {
}
protected function initGeneralSettings(): void {
$this->initialState->provideInitialState('default_group_notification', (int)$this->serverConfig->getAppValue('spreed', 'default_group_notification', (string)Participant::NOTIFY_MENTION));
$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('valid_apache_php_configuration', $this->validApachePHPConfiguration());

View file

@ -172,6 +172,8 @@ for OCC in occ_host occ_remote; do
${OCC} config:system:set debug --value true --type bool
# Use faster password hashing
${OCC} config:system:set hashing_default_password --value=true --type=bool
# Change the default group notification level for more variate in default tests
${OCC} config:app:set spreed default_group_notification --value=2 --type=integer
# Build skip list
MAJOR_VERSION=$(${OCC} status | grep -Eo 'version: ([0-9]+).' | grep -Eo '[0-9]+')