Check DialogListId identifier validness.

This commit is contained in:
levlam 2023-08-21 16:23:11 +03:00
parent 0e9b4be29f
commit 08ead89f31

View File

@ -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 <class T, typename = std::enable_if_t<std::is_convertible<T, int32>::value>>
@ -71,9 +73,6 @@ class DialogListId {
if (folder_id == FolderId::archive()) {
return td_api::make_object<td_api::chatListArchive>();
}
if (folder_id == FolderId::main()) {
return td_api::make_object<td_api::chatListMain>();
}
return td_api::make_object<td_api::chatListMain>();
}
if (is_filter()) {