feat(max-duration): Add a capability

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2024-10-08 14:24:02 +02:00
parent 784e343b1f
commit 97de780bfa
No known key found for this signature in database
GPG key ID: F72FA5B49FFA96B0
21 changed files with 70 additions and 8 deletions

View file

@ -159,3 +159,4 @@
## 20.1
* `archived-conversations` (local) - Conversations can be marked as archived which will hide them from the conversation list by default
* `config => call => start-without-media` (local) - Boolean, whether media should be disabled when starting or joining a conversation
* `config => call => max-duration` - Integer, maximum call duration in seconds. Please note that this should only be used with system cron and with a reasonable high value, due to the expended duration until the background job ran.

View file

@ -198,6 +198,7 @@ class Capabilities implements IPublicCapability {
'sip-dialout-enabled' => $this->talkConfig->isSIPDialOutEnabled(),
'can-enable-sip' => false,
'start-without-media' => $this->talkConfig->getCallsStartWithoutMedia($user?->getUID()),
'max-duration' => $this->appConfig->getAppValueInt('max_call_duration'),
],
'chat' => [
'max-length' => ChatManager::MAX_CHAT_LENGTH,

View file

@ -340,6 +340,7 @@ namespace OCA\Talk;
* sip-dialout-enabled: bool,
* can-enable-sip: bool,
* start-without-media: bool,
* max-duration: int,
* },
* chat: array{
* max-length: int,

View file

@ -148,7 +148,8 @@
"sip-enabled",
"sip-dialout-enabled",
"can-enable-sip",
"start-without-media"
"start-without-media",
"max-duration"
],
"properties": {
"enabled": {
@ -190,6 +191,10 @@
},
"start-without-media": {
"type": "boolean"
},
"max-duration": {
"type": "integer",
"format": "int64"
}
}
},

View file

@ -81,7 +81,8 @@
"sip-enabled",
"sip-dialout-enabled",
"can-enable-sip",
"start-without-media"
"start-without-media",
"max-duration"
],
"properties": {
"enabled": {
@ -123,6 +124,10 @@
},
"start-without-media": {
"type": "boolean"
},
"max-duration": {
"type": "integer",
"format": "int64"
}
}
},

View file

@ -81,7 +81,8 @@
"sip-enabled",
"sip-dialout-enabled",
"can-enable-sip",
"start-without-media"
"start-without-media",
"max-duration"
],
"properties": {
"enabled": {
@ -123,6 +124,10 @@
},
"start-without-media": {
"type": "boolean"
},
"max-duration": {
"type": "integer",
"format": "int64"
}
}
},

View file

@ -124,7 +124,8 @@
"sip-enabled",
"sip-dialout-enabled",
"can-enable-sip",
"start-without-media"
"start-without-media",
"max-duration"
],
"properties": {
"enabled": {
@ -166,6 +167,10 @@
},
"start-without-media": {
"type": "boolean"
},
"max-duration": {
"type": "integer",
"format": "int64"
}
}
},

View file

@ -81,7 +81,8 @@
"sip-enabled",
"sip-dialout-enabled",
"can-enable-sip",
"start-without-media"
"start-without-media",
"max-duration"
],
"properties": {
"enabled": {
@ -123,6 +124,10 @@
},
"start-without-media": {
"type": "boolean"
},
"max-duration": {
"type": "integer",
"format": "int64"
}
}
},

View file

@ -124,7 +124,8 @@
"sip-enabled",
"sip-dialout-enabled",
"can-enable-sip",
"start-without-media"
"start-without-media",
"max-duration"
],
"properties": {
"enabled": {
@ -166,6 +167,10 @@
},
"start-without-media": {
"type": "boolean"
},
"max-duration": {
"type": "integer",
"format": "int64"
}
}
},

View file

@ -286,7 +286,8 @@
"sip-enabled",
"sip-dialout-enabled",
"can-enable-sip",
"start-without-media"
"start-without-media",
"max-duration"
],
"properties": {
"enabled": {
@ -328,6 +329,10 @@
},
"start-without-media": {
"type": "boolean"
},
"max-duration": {
"type": "integer",
"format": "int64"
}
}
},

View file

@ -227,7 +227,8 @@
"sip-enabled",
"sip-dialout-enabled",
"can-enable-sip",
"start-without-media"
"start-without-media",
"max-duration"
],
"properties": {
"enabled": {
@ -269,6 +270,10 @@
},
"start-without-media": {
"type": "boolean"
},
"max-duration": {
"type": "integer",
"format": "int64"
}
}
},

View file

@ -113,6 +113,7 @@ export const mockedCapabilities: Capabilities = {
'sip-dialout-enabled': true,
'can-enable-sip': true,
'start-without-media': false,
'max-duration': 0,
},
chat: {
'max-length': 32000,

View file

@ -229,6 +229,8 @@ export type components = {
"sip-dialout-enabled": boolean;
"can-enable-sip": boolean;
"start-without-media": boolean;
/** Format: int64 */
"max-duration": number;
};
chat: {
/** Format: int64 */

View file

@ -63,6 +63,8 @@ export type components = {
"sip-dialout-enabled": boolean;
"can-enable-sip": boolean;
"start-without-media": boolean;
/** Format: int64 */
"max-duration": number;
};
chat: {
/** Format: int64 */

View file

@ -49,6 +49,8 @@ export type components = {
"sip-dialout-enabled": boolean;
"can-enable-sip": boolean;
"start-without-media": boolean;
/** Format: int64 */
"max-duration": number;
};
chat: {
/** Format: int64 */

View file

@ -144,6 +144,8 @@ export type components = {
"sip-dialout-enabled": boolean;
"can-enable-sip": boolean;
"start-without-media": boolean;
/** Format: int64 */
"max-duration": number;
};
chat: {
/** Format: int64 */

View file

@ -67,6 +67,8 @@ export type components = {
"sip-dialout-enabled": boolean;
"can-enable-sip": boolean;
"start-without-media": boolean;
/** Format: int64 */
"max-duration": number;
};
chat: {
/** Format: int64 */

View file

@ -175,6 +175,8 @@ export type components = {
"sip-dialout-enabled": boolean;
"can-enable-sip": boolean;
"start-without-media": boolean;
/** Format: int64 */
"max-duration": number;
};
chat: {
/** Format: int64 */

View file

@ -1883,6 +1883,8 @@ export type components = {
"sip-dialout-enabled": boolean;
"can-enable-sip": boolean;
"start-without-media": boolean;
/** Format: int64 */
"max-duration": number;
};
chat: {
/** Format: int64 */

View file

@ -1380,6 +1380,8 @@ export type components = {
"sip-dialout-enabled": boolean;
"can-enable-sip": boolean;
"start-without-media": boolean;
/** Format: int64 */
"max-duration": number;
};
chat: {
/** Format: int64 */

View file

@ -120,6 +120,7 @@ class CapabilitiesTest extends TestCase {
'sip-dialout-enabled' => false,
'can-enable-sip' => false,
'start-without-media' => false,
'max-duration' => 0,
'predefined-backgrounds' => [
'1_office.jpg',
'2_home.jpg',
@ -254,6 +255,7 @@ class CapabilitiesTest extends TestCase {
'sip-dialout-enabled' => false,
'can-enable-sip' => false,
'start-without-media' => false,
'max-duration' => 0,
'predefined-backgrounds' => [
'1_office.jpg',
'2_home.jpg',