hideChat method

Future<void> hideChat(
  1. ChatId id, [
  2. bool clear = false
])

Hides the Chat identified by the provided id and clears its history as well if clear is true.

Implementation

Future<void> hideChat(ChatId id, [bool clear = false]) async {
  try {
    await _chatService.hideChat(id);

    if (clear) {
      await _chatService.clearChat(id);
    }
  } on HideChatException catch (e) {
    MessagePopup.error(e);
  } on ClearChatException catch (e) {
    MessagePopup.error(e);
  } on UnfavoriteChatException catch (e) {
    MessagePopup.error(e);
  } catch (e) {
    MessagePopup.error(e);
    rethrow;
  }
}