From 08ead89f311492177662afa2bc143c9638fe4b08 Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 21 Aug 2023 16:23:11 +0300 Subject: [PATCH] Check DialogListId identifier validness. --- td/telegram/DialogListId.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/td/telegram/DialogListId.h b/td/telegram/DialogListId.h index 4391c8714..a82e7e168 100644 --- a/td/telegram/DialogListId.h +++ b/td/telegram/DialogListId.h @@ -30,6 +30,8 @@ class DialogListId { explicit constexpr DialogListId(int64 dialog_list_id) : id(dialog_list_id) { if (is_folder() && get_folder_id() != FolderId::archive()) { id = FolderId::main().get(); + } else if (is_filter()) { + CHECK(get_filter_id().is_valid()); } } template ::value>> @@ -71,9 +73,6 @@ class DialogListId { if (folder_id == FolderId::archive()) { return td_api::make_object(); } - if (folder_id == FolderId::main()) { - return td_api::make_object(); - } return td_api::make_object(); } if (is_filter()) {