ensureRemoteMonolog method

Future<RxChatImpl> ensureRemoteMonolog({
  1. ChatName? name,
  2. bool? isHidden,
})

Ensures the provided Chat-monolog is remotely accessible.

Implementation

Future<RxChatImpl> ensureRemoteMonolog({
  ChatName? name,
  bool? isHidden,
}) async {
  Log.debug('ensureRemoteMonolog($name)', '$runtimeType');

  final ChatData chatData = _chat(
    await _graphQlProvider.createMonologChat(name: name),
  );
  final RxChatImpl chat = await _putEntry(chatData);

  if (!isClosed) {
    await _monologLocal.upsert(me, monolog = chat.id);
  }

  return chat;
}