generateCredentials method
- ChatId chatId
override
Generates the ChatCallCredentials for a Chat identified by the
provided chatId
.
These ChatCallCredentials are considered backup and should be linked to an OngoingCall by calling transferCredentials once its ChatItemId is acquired.
Implementation
@override
Future<ChatCallCredentials> generateCredentials(ChatId chatId) async {
Log.debug('generateCredentials($chatId)', '$runtimeType');
ChatCallCredentials? creds = await _chatCredentialsProvider.read(chatId);
if (creds == null) {
creds = ChatCallCredentials(const Uuid().v4());
_chatCredentialsProvider.upsert(chatId, creds);
}
return creds;
}