Minor improvements.

This commit is contained in:
levlam 2021-04-09 02:35:50 +03:00
parent 338e4085d5
commit 969b52cc82
8 changed files with 12 additions and 10 deletions

View File

@ -90,15 +90,15 @@ Status DialogFilter::check_limits() const {
if (excluded_server_dialog_count > MAX_INCLUDED_FILTER_DIALOGS || if (excluded_server_dialog_count > MAX_INCLUDED_FILTER_DIALOGS ||
excluded_secret_dialog_count > MAX_INCLUDED_FILTER_DIALOGS) { excluded_secret_dialog_count > MAX_INCLUDED_FILTER_DIALOGS) {
return Status::Error(400, "Maximum number of excluded chats exceeded"); return Status::Error(400, "The maximum number of excluded chats exceeded");
} }
if (included_server_dialog_count > MAX_INCLUDED_FILTER_DIALOGS || if (included_server_dialog_count > MAX_INCLUDED_FILTER_DIALOGS ||
included_secret_dialog_count > MAX_INCLUDED_FILTER_DIALOGS) { included_secret_dialog_count > MAX_INCLUDED_FILTER_DIALOGS) {
return Status::Error(400, "Maximum number of included chats exceeded"); return Status::Error(400, "The maximum number of included chats exceeded");
} }
if (included_server_dialog_count + pinned_server_dialog_count > MAX_INCLUDED_FILTER_DIALOGS || if (included_server_dialog_count + pinned_server_dialog_count > MAX_INCLUDED_FILTER_DIALOGS ||
included_secret_dialog_count + pinned_secret_dialog_count > MAX_INCLUDED_FILTER_DIALOGS) { included_secret_dialog_count + pinned_secret_dialog_count > MAX_INCLUDED_FILTER_DIALOGS) {
return Status::Error(400, "Maximum number of pinned chats exceeded"); return Status::Error(400, "The maximum number of pinned chats exceeded");
} }
if (is_empty(false)) { if (is_empty(false)) {

View File

@ -11,6 +11,7 @@
#include "td/telegram/td_api.h" #include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h" #include "td/telegram/telegram_api.h"
#include "td/telegram/UserId.h" #include "td/telegram/UserId.h"
#include "td/telegram/Version.h"
#include "td/utils/common.h" #include "td/utils/common.h"
#include "td/utils/StringBuilder.h" #include "td/utils/StringBuilder.h"

View File

@ -51,7 +51,6 @@
#include "td/telegram/secret_api.hpp" #include "td/telegram/secret_api.hpp"
#include "td/telegram/SecureValue.h" #include "td/telegram/SecureValue.h"
#include "td/telegram/SecureValue.hpp" #include "td/telegram/SecureValue.hpp"
#include "td/telegram/ServerMessageId.h"
#include "td/telegram/StickersManager.h" #include "td/telegram/StickersManager.h"
#include "td/telegram/StickersManager.hpp" #include "td/telegram/StickersManager.hpp"
#include "td/telegram/Td.h" #include "td/telegram/Td.h"

View File

@ -17905,7 +17905,7 @@ void MessagesManager::create_dialog_filter(td_api::object_ptr<td_api::chatFilter
Promise<td_api::object_ptr<td_api::chatFilterInfo>> &&promise) { Promise<td_api::object_ptr<td_api::chatFilterInfo>> &&promise) {
CHECK(!td_->auth_manager_->is_bot()); CHECK(!td_->auth_manager_->is_bot());
if (dialog_filters_.size() >= MAX_DIALOG_FILTERS) { if (dialog_filters_.size() >= MAX_DIALOG_FILTERS) {
return promise.set_error(Status::Error(400, "Maximum number of chat folders exceeded")); return promise.set_error(Status::Error(400, "The maximum number of chat folders exceeded"));
} }
if (!is_update_chat_filters_sent_) { if (!is_update_chat_filters_sent_) {
return promise.set_error(Status::Error(400, "Chat folders are not synchronized yet")); return promise.set_error(Status::Error(400, "Chat folders are not synchronized yet"));
@ -18741,7 +18741,7 @@ Status MessagesManager::toggle_dialog_is_pinned(DialogListId dialog_list_id, Dia
: pinned_dialog_count - secret_pinned_dialog_count; : pinned_dialog_count - secret_pinned_dialog_count;
if (dialog_count >= static_cast<size_t>(get_pinned_dialogs_limit(dialog_list_id))) { if (dialog_count >= static_cast<size_t>(get_pinned_dialogs_limit(dialog_list_id))) {
return Status::Error(400, "Maximum number of pinned chats exceeded"); return Status::Error(400, "The maximum number of pinned chats exceeded");
} }
} }
@ -18824,7 +18824,7 @@ Status MessagesManager::set_pinned_dialogs(DialogListId dialog_list_id, vector<D
} }
if (dialog_count > dialog_count_limit || secret_dialog_count > dialog_count_limit) { if (dialog_count > dialog_count_limit || secret_dialog_count > dialog_count_limit) {
return Status::Error(400, "Maximum number of pinned chats exceeded"); return Status::Error(400, "The maximum number of pinned chats exceeded");
} }
} }
std::unordered_set<DialogId, DialogIdHash> new_pinned_dialog_ids(dialog_ids.begin(), dialog_ids.end()); std::unordered_set<DialogId, DialogIdHash> new_pinned_dialog_ids(dialog_ids.begin(), dialog_ids.end());
@ -37387,7 +37387,7 @@ Result<ServerMessageId> MessagesManager::get_payment_successful_message_id(FullM
return Status::Error(5, "Message has wrong type"); return Status::Error(5, "Message has wrong type");
} }
if (m->message_id.is_scheduled()) { if (m->message_id.is_scheduled()) {
return Status::Error(5, "Wrong sheduled message identifier"); return Status::Error(5, "Wrong scheduled message identifier");
} }
if (!m->message_id.is_server()) { if (!m->message_id.is_server()) {
return Status::Error(5, "Wrong message identifier"); return Status::Error(5, "Wrong message identifier");

View File

@ -6,6 +6,7 @@
// //
#include "td/telegram/Payments.h" #include "td/telegram/Payments.h"
#include "td/telegram/AccessRights.h"
#include "td/telegram/ContactsManager.h" #include "td/telegram/ContactsManager.h"
#include "td/telegram/files/FileManager.h" #include "td/telegram/files/FileManager.h"
#include "td/telegram/files/FileType.h" #include "td/telegram/files/FileType.h"

View File

@ -9,6 +9,7 @@
#include "td/actor/PromiseFuture.h" #include "td/actor/PromiseFuture.h"
#include "td/telegram/DialogId.h" #include "td/telegram/DialogId.h"
#include "td/telegram/files/FileId.h"
#include "td/telegram/FullMessageId.h" #include "td/telegram/FullMessageId.h"
#include "td/telegram/MessageId.h" #include "td/telegram/MessageId.h"
#include "td/telegram/Photo.h" #include "td/telegram/Photo.h"

View File

@ -11,9 +11,9 @@
#include "td/telegram/logevent/SecretChatEvent.h" #include "td/telegram/logevent/SecretChatEvent.h"
#include "td/telegram/MessageId.h" #include "td/telegram/MessageId.h"
#include "td/telegram/net/NetQuery.h" #include "td/telegram/net/NetQuery.h"
#include "td/telegram/secret_api.h"
#include "td/telegram/SecretChatDb.h" #include "td/telegram/SecretChatDb.h"
#include "td/telegram/SecretChatId.h" #include "td/telegram/SecretChatId.h"
#include "td/telegram/secret_api.h"
#include "td/telegram/telegram_api.h" #include "td/telegram/telegram_api.h"
#include "td/telegram/UserId.h" #include "td/telegram/UserId.h"

View File

@ -75,7 +75,7 @@ Status Wget::try_init() {
TRY_RESULT(fd, SocketFd::open(addr)); TRY_RESULT(fd, SocketFd::open(addr));
if (fd.empty()) { if (fd.empty()) {
return td::Status::Error("Sockets are not supported"); return Status::Error("Sockets are not supported");
} }
if (url.protocol_ == HttpUrl::Protocol::Http) { if (url.protocol_ == HttpUrl::Protocol::Http) {
connection_ = create_actor<HttpOutboundConnection>("Connect", std::move(fd), SslStream{}, connection_ = create_actor<HttpOutboundConnection>("Connect", std::move(fd), SslStream{},