diff --git a/docs/settings.md b/docs/settings.md index 2ac4f70fcfb..d256f8b26e1 100644 --- a/docs/settings.md +++ b/docs/settings.md @@ -108,7 +108,7 @@ Legend: | `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 | `604800` | 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 | diff --git a/lib/BackgroundJob/ExpireObjectRooms.php b/lib/BackgroundJob/ExpireObjectRooms.php index 050014a2f34..6895e2a5243 100644 --- a/lib/BackgroundJob/ExpireObjectRooms.php +++ b/lib/BackgroundJob/ExpireObjectRooms.php @@ -49,7 +49,7 @@ protected function run($argument): void { $this->executeRetention(Room::OBJECT_TYPE_INSTANT_MEETING, $instantMeetingRetention * 24 * 3600); } - // Classified conversations are deleted shortly (default 1 hour) after a + // Classified conversations are deleted (default 7 days) after a // call happened, unless a moderator kept them (object_type is then // "classified_persist" and no longer matched here). $classifiedRetention = $this->appConfig->getAppValueInt(Config::RETENTION_CLASSIFIED_ROOMS); diff --git a/lib/ConfigLexicon.php b/lib/ConfigLexicon.php index fb37bcf6ea5..8747b2e7625 100644 --- a/lib/ConfigLexicon.php +++ b/lib/ConfigLexicon.php @@ -148,7 +148,7 @@ public function getAppConfigs(): array { new Entry(UserPreference::CONVERSATIONS_LIST_STYLE, ValueType::STRING, UserPreference::CONVERSATION_LIST_STYLE_TWO_LINES), new Entry(UserPreference::CHAT_STYLE, ValueType::STRING, UserPreference::CHAT_STYLE_SPLIT), new Entry(SignalingManager::HAS_FEATURE_CHANGED_USERS, ValueType::BOOL, false), - new Entry(Config::RETENTION_CLASSIFIED_ROOMS, ValueType::INT, 3600, definition: 'Retention period of classified conversations in seconds after a call happened (`0` means no-retention)'), + new Entry(Config::RETENTION_CLASSIFIED_ROOMS, ValueType::INT, 604800, definition: 'Retention period of classified conversations in seconds after a call happened (`0` means no-retention)'), new Entry(Config::STUN_SERVERS, ValueType::ARRAY, [Config::DEFAULT_STUN_SERVER], definition: 'List of STUN servers for WebRTC connections', flags: IAppConfig::FLAG_SENSITIVE), new Entry(Config::TURN_SERVERS, ValueType::ARRAY, [], definition: 'List of TURN servers for WebRTC connections', flags: IAppConfig::FLAG_SENSITIVE), new Entry(Config::ALLOWED_GROUPS_TALK, ValueType::ARRAY, [], definition: 'List of group ids that are allowed to use Talk'), diff --git a/lib/RoomPresets/Classified.php b/lib/RoomPresets/Classified.php index b702abbec4b..be2a7260fcb 100644 --- a/lib/RoomPresets/Classified.php +++ b/lib/RoomPresets/Classified.php @@ -42,8 +42,8 @@ public function getParameters(): array { Parameter::LISTABLE->value => Room::LISTABLE_NONE, // No SIP dial-in/out Parameter::SIP_ENABLED->value => Webinary::SIP_DISABLED, - // Messages expire after one hour by default - Parameter::MESSAGE_EXPIRATION->value => 3600, + // Messages expire after 7 days by default + Parameter::MESSAGE_EXPIRATION->value => 604800, ]; } } diff --git a/src/components/UIShared/ConversationActionsShortcut.vue b/src/components/UIShared/ConversationActionsShortcut.vue index e5771bec716..cb3ad2925b8 100644 --- a/src/components/UIShared/ConversationActionsShortcut.vue +++ b/src/components/UIShared/ConversationActionsShortcut.vue @@ -59,9 +59,17 @@ const descriptionLabel = computed(() => { if (expirationDuration.value === 0) { return t('spreed', 'Would you like to delete this conversation?') } - if (isClassified.value) { + if (isClassified.value && expirationDuration.value! % 86400 !== 0) { // Classified conversations are auto-deleted for everyone after a call; - // the server value is in seconds, shown to the user in minutes + // the server value is in seconds, shown in days or hours when possible, otherwise in minutes + if (expirationDuration.value! % 3600 === 0) { + return n( + 'spreed', + 'This conversation will be automatically deleted for everyone after %n hour of inactivity.', + 'This conversation will be automatically deleted for everyone after %n hours of inactivity.', + expirationDuration.value! / 3600, + ) + } const retentionMinutes = Math.round(expirationDuration.value! / 60) return n( 'spreed', @@ -74,7 +82,7 @@ const descriptionLabel = computed(() => { 'spreed', 'This conversation will be automatically deleted for everyone after %n day of inactivity.', 'This conversation will be automatically deleted for everyone after %n days of inactivity.', - expirationDuration.value!, + isClassified.value ? expirationDuration.value! / 86400 : expirationDuration.value!, ) }) diff --git a/tests/integration/features/conversation-4/classified-retention.feature b/tests/integration/features/conversation-4/classified-retention.feature index c8c79c92281..3eaa1ab8fef 100644 --- a/tests/integration/features/conversation-4/classified-retention.feature +++ b/tests/integration/features/conversation-4/classified-retention.feature @@ -9,7 +9,7 @@ Feature: conversation-4/classified-retention | preset | classified | And user "participant1" is participant of room "classified" (v4) # Without a call the conversation is not queued for deletion and survives the sweep - And age room "classified" 2 hours + And age room "classified" 8 days When force run "OCA\Talk\BackgroundJob\ExpireObjectRooms" background jobs Then user "participant1" is participant of room "classified" (v4) # A call happens and ends, which queues the conversation for deletion @@ -20,7 +20,7 @@ Feature: conversation-4/classified-retention And user "participant1" is participant of the following rooms (v4) | id | objectType | | classified | classified | - And age room "classified" 2 hours + And age room "classified" 8 days When force run "OCA\Talk\BackgroundJob\ExpireObjectRooms" background jobs Then user "participant1" is not participant of room "classified" (v4) @@ -46,7 +46,7 @@ Feature: conversation-4/classified-retention And user "participant1" is participant of the following rooms (v4) | id | objectType | | classified | classified | - And age room "classified" 2 hours + And age room "classified" 8 days When force run "OCA\Talk\BackgroundJob\ExpireObjectRooms" background jobs Then user "participant1" is not participant of room "classified" (v4) @@ -67,7 +67,7 @@ Feature: conversation-4/classified-retention And user "participant1" is participant of the following rooms (v4) | id | objectType | | classified | classified_persist | - And age room "classified" 2 hours + And age room "classified" 8 days When force run "OCA\Talk\BackgroundJob\ExpireObjectRooms" background jobs Then user "participant1" is participant of room "classified" (v4) # A later call must not re-queue it for deletion diff --git a/tests/integration/features/conversation-4/presets.feature b/tests/integration/features/conversation-4/presets.feature index ffc6d665791..f5dbcf55eb3 100644 --- a/tests/integration/features/conversation-4/presets.feature +++ b/tests/integration/features/conversation-4/presets.feature @@ -10,7 +10,7 @@ Feature: conversation-4/presets | forced | forced | [] | | webinar | Webinar | {"lobbyState":1,"mentionPermissions":1,"permissions":389,"recordingConsent":1,"roomType":3} | | presentation | Presentation | {"mentionPermissions":1,"permissions":389,"recordingConsent":1} | - | classified | Classified conversation | {"roomType":2,"listable":0,"sipEnabled":0,"messageExpiration":3600} | + | classified | Classified conversation | {"roomType":2,"listable":0,"sipEnabled":0,"messageExpiration":604800} | | channel | Channel | {"listable":1,"permissions":257} | | voiceroom | Voice room | {"listable":1,"messageExpiration":3600} | And the following "spreed" app config is set @@ -24,7 +24,7 @@ Feature: conversation-4/presets | forced | forced | {"listable":0,"messageExpiration":7200,"sipEnabled":1} | | webinar | Webinar | {"lobbyState":1,"mentionPermissions":1,"permissions":389,"recordingConsent":1,"roomType":3} | | presentation | Presentation | {"mentionPermissions":1,"permissions":389,"recordingConsent":1} | - | classified | Classified conversation | {"roomType":2,"listable":0,"sipEnabled":0,"messageExpiration":3600} | + | classified | Classified conversation | {"roomType":2,"listable":0,"sipEnabled":0,"messageExpiration":604800} | | channel | Channel | {"listable":1,"permissions":257} | | voiceroom | Voice room | {"listable":1,"messageExpiration":3600} | @@ -36,7 +36,7 @@ Feature: conversation-4/presets | forced | forced | [] | | webinar | Webinar | {"lobbyState":1,"mentionPermissions":1,"permissions":389,"recordingConsent":1,"roomType":3} | | presentation | Presentation | {"mentionPermissions":1,"permissions":389,"recordingConsent":1} | - | classified | Classified conversation | {"roomType":2,"listable":0,"sipEnabled":0,"messageExpiration":3600} | + | classified | Classified conversation | {"roomType":2,"listable":0,"sipEnabled":0,"messageExpiration":604800} | | channel | Channel | {"listable":1,"permissions":257} | | announcement | Announcement | {"listable":0,"permissions":257} | | voiceroom | Voice room | {"listable":1,"messageExpiration":3600} | @@ -47,7 +47,7 @@ Feature: conversation-4/presets | forced | forced | [] | | webinar | Webinar | {"lobbyState":1,"mentionPermissions":1,"permissions":389,"recordingConsent":1,"roomType":3} | | presentation | Presentation | {"mentionPermissions":1,"permissions":389,"recordingConsent":1} | - | classified | Classified conversation | {"roomType":2,"listable":0,"sipEnabled":0,"messageExpiration":3600} | + | classified | Classified conversation | {"roomType":2,"listable":0,"sipEnabled":0,"messageExpiration":604800} | | channel | Channel | {"listable":1,"permissions":257} | | voiceroom | Voice room | {"listable":1,"messageExpiration":3600} | diff --git a/tests/php/RoomPresets/ClassifiedTest.php b/tests/php/RoomPresets/ClassifiedTest.php index 2a02510dd33..9775a13d724 100644 --- a/tests/php/RoomPresets/ClassifiedTest.php +++ b/tests/php/RoomPresets/ClassifiedTest.php @@ -42,6 +42,6 @@ public function testParametersLockDownTheConversation(): void { $this->assertSame(Room::TYPE_GROUP, $parameters[Parameter::ROOM_TYPE->value], 'Classified conversations must not be public'); $this->assertSame(Room::LISTABLE_NONE, $parameters[Parameter::LISTABLE->value], 'Classified conversations must not be openly joinable'); $this->assertSame(Webinary::SIP_DISABLED, $parameters[Parameter::SIP_ENABLED->value], 'Classified conversations must not allow SIP'); - $this->assertSame(3600, $parameters[Parameter::MESSAGE_EXPIRATION->value], 'Classified conversations expire messages after one hour'); + $this->assertSame(604800, $parameters[Parameter::MESSAGE_EXPIRATION->value], 'Classified conversations expire messages after 7 days'); } }