Skip to content

Commit 11736b2

Browse files
Brazold3xvn
andauthored
fix(llc): watch support for queryCalls method (#722)
* watch support for queryCalls method * Update docusaurus/docs/Flutter/03-core-concepts/06-querying-calls.mdx --------- Co-authored-by: Deven Joshi <[email protected]>
1 parent 20a535c commit 11736b2

File tree

5 files changed

+17
-1
lines changed

5 files changed

+17
-1
lines changed

docusaurus/docs/Flutter/03-core-concepts/06-querying-calls.mdx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,13 @@ final result = await video.queryCalls(
7474
);
7575
```
7676

77-
The `queryCalls` function can take multiple sort parameters, which can be combined with filtering to give you powerful control over the data in your application.
77+
The `queryCalls` function can take multiple sort parameters, which can be combined with filtering to give you powerful control over the data in your application.
78+
79+
### Watching calls
80+
81+
If you specify `watch` parameter as `true`, the SDK will create a subscription to the call data on the server and you'll be able to receive updates in real-time.
82+
83+
The server will send updates to the client when the call data changes (for example, members are updated, a call session has started, etc...). This is useful for showing a live preview of who is in the call or building a call dashboard.
84+
85+
You can listen to call events via the `StreamVideo.instance.events` stream.
86+

packages/stream_video/lib/src/coordinator/coordinator_client.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ abstract class CoordinatorClient {
187187
String? prev,
188188
List<open.SortParam> sorts = const [],
189189
int? limit,
190+
bool? watch,
190191
});
191192

192193
Future<Result<None>> blockUser({

packages/stream_video/lib/src/coordinator/open_api/coordinator_client_open_api.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -875,6 +875,7 @@ class CoordinatorClientOpenApi extends CoordinatorClient {
875875
String? prev,
876876
List<open.SortParam> sorts = const [],
877877
int? limit,
878+
bool? watch,
878879
}) async {
879880
try {
880881
final connectionResult = await _waitUntilConnected();
@@ -889,6 +890,7 @@ class CoordinatorClientOpenApi extends CoordinatorClient {
889890
prev: prev,
890891
sort: sorts,
891892
limit: limit,
893+
watch: watch,
892894
),
893895
);
894896
if (result == null) {

packages/stream_video/lib/src/coordinator/retry/coordinator_client_retry.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ class CoordinatorClientRetry extends CoordinatorClient {
334334
String? prev,
335335
List<open.SortParam> sorts = const [],
336336
int? limit,
337+
bool? watch,
337338
}) {
338339
return _retryManager.execute(
339340
() => _delegate.queryCalls(
@@ -342,6 +343,7 @@ class CoordinatorClientRetry extends CoordinatorClient {
342343
prev: prev,
343344
sorts: sorts,
344345
limit: limit,
346+
watch: watch,
345347
),
346348
(error, nextAttemptDelay) async {
347349
_logRetry('queryCalls', error, nextAttemptDelay);

packages/stream_video/lib/src/stream_video.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,13 +527,15 @@ class StreamVideo extends Disposable {
527527
String? prev,
528528
int? limit,
529529
List<open.SortParam>? sorts,
530+
bool? watch,
530531
}) {
531532
return _client.queryCalls(
532533
filterConditions: filterConditions,
533534
next: next,
534535
limit: limit,
535536
prev: prev,
536537
sorts: sorts ?? [],
538+
watch: watch,
537539
);
538540
}
539541

0 commit comments

Comments
 (0)