incomingCalls method
- int? first,
- IncomingChatCallsCursor? after,
- int? last,
- IncomingChatCallsCursor? before,
Returns a list of incoming ChatCalls of the authenticated MyUser.
A ChatCall is considered incoming when:
- it's not yet answered or declined;
- its Chat is not muted by the authenticated MyUser;
- its initiator is not the authenticated MyUser.
This list contains ChatCalls which require an immediate action from the authenticated MyUser and doesn't represent any historical data.
A new ChatCall appears in this list when someone other than the authenticated MyUser starts it in a Chat, and that Chat is not muted by the authenticated MyUser.
A ChatCall is removed from this list when:
- it has been finished;
- MyUser executes joinChatCall or declineChatCall on it;
- MyUser executes
Mutation.muteChat
on its Chat (orMutation.muteMyUser
on himself).
Executing Mutation.muteMyUser
makes this list always empty until the
consecutive execution of Mutation.unmuteMyUser
or reaching the mute's
deadline.
Authentication
Mandatory.
Pagination
It's allowed to specify both first
and last
at the same time, provided
that after
and before
cursors are equal. In such case the returned
page will include the ChatCall pointed by the cursor and the requested
count of ChatCalls preceding and following it.
If it's desired to receive the ChatCall pointed by the cursor without
querying in both directions, one can specify first
or last
count as 0.
Implementation
Future<IncomingCalls$Query$IncomingChatCalls> incomingCalls({
int? first,
IncomingChatCallsCursor? after,
int? last,
IncomingChatCallsCursor? before,
}) async {
Log.debug('incomingCalls($first, $after, $last, $before)', '$runtimeType');
final variables = IncomingCallsArguments(
first: first,
after: after,
last: last,
before: before,
);
final QueryResult result = await client.query(
QueryOptions(
operationName: 'IncomingCalls',
document: IncomingCallsQuery(variables: variables).document,
variables: variables.toJson(),
),
);
return IncomingCalls$Query.fromJson(result.data!).incomingChatCalls;
}