hide method

Future<EmptyResponse> hide({
  1. bool clearHistory = false,
})

Hides the channel from StreamChatClient.queryChannels for the user until a message is added.

If clearHistory is set to true - all messages will be removed for the user.

Implementation

Future<EmptyResponse> hide({bool clearHistory = false}) async {
  _checkInitialized();
  final response = await _client.hideChannel(
    id!,
    type,
    clearHistory: clearHistory,
  );
  if (clearHistory) {
    state!.truncate();
    final cid = _cid;
    if (cid != null) {
      await _client.chatPersistenceClient?.deleteMessageByCid(cid);
    }
  }
  return response;
}