createChatContact method

  1. @override
Future<void> createChatContact(
  1. UserName name,
  2. UserId id
)
override

Creates a new ChatContact with the specified User in the current MyUser's address book.

Implementation

@override
Future<void> createChatContact(UserName name, UserId id) async {
  Log.debug('createChatContact($name, $id)', '$runtimeType');

  final response = await _graphQlProvider.createChatContact(
    name: name,
    records: [ChatContactRecord(userId: id)],
  );

  final events = ChatContactsEventsEvent(
    ChatContactEventsVersioned(
      response.events.map((e) => _contactEvent(e)).toList(),
      response.ver,
      response.listVer,
    ),
  );

  await _contactRemoteEvent(events, updateVersion: false);
}