archiveChat method

Future<void> archiveChat(
  1. ChatId id,
  2. bool archive
)

Archives or unarchives the specified Chat identified by the provided id.

Implementation

Future<void> archiveChat(ChatId id, bool archive) async {
  try {
    await _chatService.archiveChat(id, archive);
  } on ToggleChatArchivationException catch (e) {
    MessagePopup.error(e);
  } on UnfavoriteChatException catch (e) {
    MessagePopup.error(e);
  } catch (e) {
    MessagePopup.error(e);
    rethrow;
  }
}