exit method

Future<void> exit()

Exits from this channel. The current User is no longer a participant of this channel.

Implementation

Future<void> exit() async {
  sbLog.i(StackTrace.current);

  final cmd = Command.buildExitChannel(this);
  final result = await chat.commandManager.sendCommand(cmd);
  participantCount = result?.payload['participant_count'] ?? 0;

  removeFromCache(chat);
  chat.chatContext.enteredOpenChannelUrls.remove(channelUrl);
  sbLog.i(
    StackTrace.current,
    '[remove()] enteredOpenChannels: ${chat.chatContext.enteredOpenChannelUrls.length}',
  );
}