Fix DialogListId constructor.

This commit is contained in:
levlam 2023-08-24 12:21:04 +03:00
parent 1e6970e3fe
commit 470c36ceef

View File

@ -27,7 +27,7 @@ class DialogListId {
public: public:
DialogListId() = default; DialogListId() = default;
explicit constexpr DialogListId(int64 dialog_list_id) : id(dialog_list_id) { explicit DialogListId(int64 dialog_list_id) : id(dialog_list_id) {
if (is_folder() && get_folder_id() != FolderId::archive()) { if (is_folder() && get_folder_id() != FolderId::archive()) {
id = FolderId::main().get(); id = FolderId::main().get();
} else if (is_filter()) { } else if (is_filter()) {
@ -94,7 +94,7 @@ class DialogListId {
return id != other.id; return id != other.id;
} }
constexpr bool is_folder() const { bool is_folder() const {
return std::numeric_limits<int32>::min() <= id && id <= std::numeric_limits<int32>::max(); return std::numeric_limits<int32>::min() <= id && id <= std::numeric_limits<int32>::max();
} }