decline method
- ChatId chatId
override
Declines the current OngoingCall in the specified chatId
by the
authenticated MyUser.
Implementation
@override
Future<void> decline(ChatId chatId) async {
Log.debug('decline($chatId)', '$runtimeType');
try {
await Backoff.run(
() async {
await _graphQlProvider.declineChatCall(chatId);
},
retryIf: (e) => e.isNetworkRelated,
retries: 10,
);
} on DeclineChatCallException catch (e) {
switch (e.code) {
case DeclineChatCallErrorCode.alreadyJoined:
// No-op, as this can be expected.
break;
case DeclineChatCallErrorCode.unknownChat:
// No-op, can't remove such call.
break;
case DeclineChatCallErrorCode.artemisUnknown:
rethrow;
}
} finally {
calls.remove(chatId);
}
}