aboutsummaryrefslogtreecommitdiffhomepage
path: root/td/telegram/CommonDialogManager.cpp
diff options
context:
space:
mode:
authorlevlam <levlam@telegram.org>2025-06-14 23:06:11 +0300
committerlevlam <levlam@telegram.org>2025-06-14 23:06:11 +0300
commit99491552d75d55c3ad6c8a6b149425f5ba31befa (patch)
tree57987f77f4cdf6323a299d2440c1ce9b4faefd75 /td/telegram/CommonDialogManager.cpp
parentfb04b8d40e5e3d24c30001af2e9784c91d4606c0 (diff)
Allow to pass error code and message directly to Promise::set_error.
Diffstat (limited to 'td/telegram/CommonDialogManager.cpp')
-rw-r--r--td/telegram/CommonDialogManager.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/td/telegram/CommonDialogManager.cpp b/td/telegram/CommonDialogManager.cpp
index b83353b0b..3bdeedfcc 100644
--- a/td/telegram/CommonDialogManager.cpp
+++ b/td/telegram/CommonDialogManager.cpp
@@ -102,11 +102,11 @@ std::pair<int32, vector<DialogId>> CommonDialogManager::get_common_dialogs(UserI
}
if (user_id == td_->user_manager_->get_my_id()) {
- promise.set_error(Status::Error(400, "Can't get common chats with self"));
+ promise.set_error(400, "Can't get common chats with self");
return {};
}
if (limit <= 0) {
- promise.set_error(Status::Error(400, "Parameter limit must be positive"));
+ promise.set_error(400, "Parameter limit must be positive");
return {};
}
if (limit > MAX_GET_DIALOGS) {
@@ -128,7 +128,7 @@ std::pair<int32, vector<DialogId>> CommonDialogManager::get_common_dialogs(UserI
// fallthrough
case DialogType::User:
case DialogType::SecretChat:
- promise.set_error(Status::Error(400, "Wrong offset_chat_id"));
+ promise.set_error(400, "Wrong offset_chat_id");
return {};
default:
UNREACHABLE();
@@ -147,7 +147,7 @@ std::pair<int32, vector<DialogId>> CommonDialogManager::get_common_dialogs(UserI
if (offset_dialog_id != DialogId()) {
offset_it = std::find(common_dialog_ids.begin(), common_dialog_ids.end(), offset_dialog_id);
if (offset_it == common_dialog_ids.end()) {
- promise.set_error(Status::Error(400, "Wrong offset_chat_id"));
+ promise.set_error(400, "Wrong offset_chat_id");
return {};
}
++offset_it;