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
2 changes: 1 addition & 1 deletion docs/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
2 changes: 1 addition & 1 deletion lib/BackgroundJob/ExpireObjectRooms.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion lib/ConfigLexicon.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
4 changes: 2 additions & 2 deletions lib/RoomPresets/Classified.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
];
}
}
14 changes: 11 additions & 3 deletions src/components/UIShared/ConversationActionsShortcut.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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!,
)
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

Expand All @@ -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)

Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions tests/integration/features/conversation-4/presets.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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} |

Expand All @@ -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} |
Expand All @@ -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} |

Expand Down
2 changes: 1 addition & 1 deletion tests/php/RoomPresets/ClassifiedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}
Loading