Skip to content

Commit fb841e8

Browse files
committed
feat(chat): Expose summary-threshold in capabilities
Signed-off-by: Joas Schilling <[email protected]>
1 parent b9f206c commit fb841e8

21 files changed

+80
-8
lines changed

docs/capabilities.md

+1
Original file line numberDiff line numberDiff line change
@@ -161,5 +161,6 @@
161161
* `talk-polls-drafts` - Whether moderators can store and retrieve poll drafts
162162
* `download-call-participants` - Whether the endpoints for moderators to download the call participants is available
163163
* `chat-summary-api` (local) - Whether the endpoint to get summarized chat messages in a conversation is available
164+
* `config => chat => summary-threshold` (local) - Number of unread messages that should exist to show a "Generate summary" option
164165
* `config => call => start-without-media` (local) - Boolean, whether media should be disabled when starting or joining a conversation
165166
* `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.

lib/Capabilities.php

+2
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ class Capabilities implements IPublicCapability {
144144
'read-privacy',
145145
'has-translation-providers',
146146
'typing-privacy',
147+
'summary-threshold',
147148
],
148149
'conversations' => [
149150
'can-create',
@@ -217,6 +218,7 @@ public function getCapabilities(): array {
217218
'read-privacy' => Participant::PRIVACY_PUBLIC,
218219
'has-translation-providers' => $this->translationManager->hasProviders(),
219220
'typing-privacy' => Participant::PRIVACY_PUBLIC,
221+
'summary-threshold' => 100,
220222
],
221223
'conversations' => [
222224
'can-create' => $user instanceof IUser && !$this->talkConfig->isNotAllowedToCreateConversations($user)

lib/ResponseDefinitions.php

+1
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,7 @@
354354
* read-privacy: int,
355355
* has-translation-providers: bool,
356356
* typing-privacy: int,
357+
* summary-threshold: positive-int,
357358
* },
358359
* conversations: array{
359360
* can-create: bool,

openapi-administration.json

+7-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@
204204
"max-length",
205205
"read-privacy",
206206
"has-translation-providers",
207-
"typing-privacy"
207+
"typing-privacy",
208+
"summary-threshold"
208209
],
209210
"properties": {
210211
"max-length": {
@@ -221,6 +222,11 @@
221222
"typing-privacy": {
222223
"type": "integer",
223224
"format": "int64"
225+
},
226+
"summary-threshold": {
227+
"type": "integer",
228+
"format": "int64",
229+
"minimum": 1
224230
}
225231
}
226232
},

openapi-backend-recording.json

+7-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@
137137
"max-length",
138138
"read-privacy",
139139
"has-translation-providers",
140-
"typing-privacy"
140+
"typing-privacy",
141+
"summary-threshold"
141142
],
142143
"properties": {
143144
"max-length": {
@@ -154,6 +155,11 @@
154155
"typing-privacy": {
155156
"type": "integer",
156157
"format": "int64"
158+
},
159+
"summary-threshold": {
160+
"type": "integer",
161+
"format": "int64",
162+
"minimum": 1
157163
}
158164
}
159165
},

openapi-backend-signaling.json

+7-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@
137137
"max-length",
138138
"read-privacy",
139139
"has-translation-providers",
140-
"typing-privacy"
140+
"typing-privacy",
141+
"summary-threshold"
141142
],
142143
"properties": {
143144
"max-length": {
@@ -154,6 +155,11 @@
154155
"typing-privacy": {
155156
"type": "integer",
156157
"format": "int64"
158+
},
159+
"summary-threshold": {
160+
"type": "integer",
161+
"format": "int64",
162+
"minimum": 1
157163
}
158164
}
159165
},

openapi-backend-sipbridge.json

+7-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@
180180
"max-length",
181181
"read-privacy",
182182
"has-translation-providers",
183-
"typing-privacy"
183+
"typing-privacy",
184+
"summary-threshold"
184185
],
185186
"properties": {
186187
"max-length": {
@@ -197,6 +198,11 @@
197198
"typing-privacy": {
198199
"type": "integer",
199200
"format": "int64"
201+
},
202+
"summary-threshold": {
203+
"type": "integer",
204+
"format": "int64",
205+
"minimum": 1
200206
}
201207
}
202208
},

openapi-bots.json

+7-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@
137137
"max-length",
138138
"read-privacy",
139139
"has-translation-providers",
140-
"typing-privacy"
140+
"typing-privacy",
141+
"summary-threshold"
141142
],
142143
"properties": {
143144
"max-length": {
@@ -154,6 +155,11 @@
154155
"typing-privacy": {
155156
"type": "integer",
156157
"format": "int64"
158+
},
159+
"summary-threshold": {
160+
"type": "integer",
161+
"format": "int64",
162+
"minimum": 1
157163
}
158164
}
159165
},

openapi-federation.json

+7-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@
180180
"max-length",
181181
"read-privacy",
182182
"has-translation-providers",
183-
"typing-privacy"
183+
"typing-privacy",
184+
"summary-threshold"
184185
],
185186
"properties": {
186187
"max-length": {
@@ -197,6 +198,11 @@
197198
"typing-privacy": {
198199
"type": "integer",
199200
"format": "int64"
201+
},
202+
"summary-threshold": {
203+
"type": "integer",
204+
"format": "int64",
205+
"minimum": 1
200206
}
201207
}
202208
},

openapi-full.json

+7-1
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,8 @@
356356
"max-length",
357357
"read-privacy",
358358
"has-translation-providers",
359-
"typing-privacy"
359+
"typing-privacy",
360+
"summary-threshold"
360361
],
361362
"properties": {
362363
"max-length": {
@@ -373,6 +374,11 @@
373374
"typing-privacy": {
374375
"type": "integer",
375376
"format": "int64"
377+
},
378+
"summary-threshold": {
379+
"type": "integer",
380+
"format": "int64",
381+
"minimum": 1
376382
}
377383
}
378384
},

openapi.json

+7-1
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,8 @@
297297
"max-length",
298298
"read-privacy",
299299
"has-translation-providers",
300-
"typing-privacy"
300+
"typing-privacy",
301+
"summary-threshold"
301302
],
302303
"properties": {
303304
"max-length": {
@@ -314,6 +315,11 @@
314315
"typing-privacy": {
315316
"type": "integer",
316317
"format": "int64"
318+
},
319+
"summary-threshold": {
320+
"type": "integer",
321+
"format": "int64",
322+
"minimum": 1
317323
}
318324
}
319325
},

src/__mocks__/capabilities.ts

+2
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ export const mockedCapabilities: Capabilities = {
125125
'read-privacy': 0,
126126
'has-translation-providers': true,
127127
'typing-privacy': 0,
128+
'summary-threshold': 100,
128129
},
129130
conversations: {
130131
'can-create': true,
@@ -156,6 +157,7 @@ export const mockedCapabilities: Capabilities = {
156157
'read-privacy',
157158
'has-translation-providers',
158159
'typing-privacy',
160+
'summary-threshold',
159161
],
160162
conversations: [
161163
'can-create',

src/types/openapi/openapi-administration.ts

+2
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,8 @@ export type components = {
240240
"has-translation-providers": boolean;
241241
/** Format: int64 */
242242
"typing-privacy": number;
243+
/** Format: int64 */
244+
"summary-threshold": number;
243245
};
244246
conversations: {
245247
"can-create": boolean;

src/types/openapi/openapi-backend-recording.ts

+2
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ export type components = {
7474
"has-translation-providers": boolean;
7575
/** Format: int64 */
7676
"typing-privacy": number;
77+
/** Format: int64 */
78+
"summary-threshold": number;
7779
};
7880
conversations: {
7981
"can-create": boolean;

src/types/openapi/openapi-backend-signaling.ts

+2
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ export type components = {
6060
"has-translation-providers": boolean;
6161
/** Format: int64 */
6262
"typing-privacy": number;
63+
/** Format: int64 */
64+
"summary-threshold": number;
6365
};
6466
conversations: {
6567
"can-create": boolean;

src/types/openapi/openapi-backend-sipbridge.ts

+2
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ export type components = {
155155
"has-translation-providers": boolean;
156156
/** Format: int64 */
157157
"typing-privacy": number;
158+
/** Format: int64 */
159+
"summary-threshold": number;
158160
};
159161
conversations: {
160162
"can-create": boolean;

src/types/openapi/openapi-bots.ts

+2
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ export type components = {
7878
"has-translation-providers": boolean;
7979
/** Format: int64 */
8080
"typing-privacy": number;
81+
/** Format: int64 */
82+
"summary-threshold": number;
8183
};
8284
conversations: {
8385
"can-create": boolean;

src/types/openapi/openapi-federation.ts

+2
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@ export type components = {
186186
"has-translation-providers": boolean;
187187
/** Format: int64 */
188188
"typing-privacy": number;
189+
/** Format: int64 */
190+
"summary-threshold": number;
189191
};
190192
conversations: {
191193
"can-create": boolean;

src/types/openapi/openapi-full.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1956,6 +1956,8 @@ export type components = {
19561956
"has-translation-providers": boolean;
19571957
/** Format: int64 */
19581958
"typing-privacy": number;
1959+
/** Format: int64 */
1960+
"summary-threshold": number;
19591961
};
19601962
conversations: {
19611963
"can-create": boolean;

src/types/openapi/openapi.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1453,6 +1453,8 @@ export type components = {
14531453
"has-translation-providers": boolean;
14541454
/** Format: int64 */
14551455
"typing-privacy": number;
1456+
/** Format: int64 */
1457+
"summary-threshold": number;
14561458
};
14571459
conversations: {
14581460
"can-create": boolean;

tests/php/CapabilitiesTest.php

+2
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ public function testGetCapabilitiesGuest(): void {
147147
'read-privacy' => 0,
148148
'has-translation-providers' => false,
149149
'typing-privacy' => 0,
150+
'summary-threshold' => 100,
150151
],
151152
'conversations' => [
152153
'can-create' => false,
@@ -277,6 +278,7 @@ public function testGetCapabilitiesUserAllowed(bool $isNotAllowed, bool $canCrea
277278
'read-privacy' => $readPrivacy,
278279
'has-translation-providers' => false,
279280
'typing-privacy' => 0,
281+
'summary-threshold' => 100,
280282
],
281283
'conversations' => [
282284
'can-create' => $canCreate,

0 commit comments

Comments
 (0)