Merge commit 'f7c01e88e36d3e49f3bf4b37ea71865324b0ecaa'
This commit is contained in:
commit
a6c0dbf160
@ -10668,7 +10668,7 @@ void ContactsManager::on_get_channel_participants_success(
|
|||||||
total_count = static_cast<int32>(result.size());
|
total_count = static_cast<int32>(result.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto max_participant_count = get_channel_type(channel_id) == ChannelType::Megagroup ? 9750 : 195;
|
const auto max_participant_count = get_channel_type(channel_id) == ChannelType::Megagroup ? 975 : 195;
|
||||||
auto participant_count =
|
auto participant_count =
|
||||||
filter.is_recent() && total_count != 0 && total_count < max_participant_count ? total_count : -1;
|
filter.is_recent() && total_count != 0 && total_count < max_participant_count ? total_count : -1;
|
||||||
int32 administrator_count = filter.is_administrators() ? total_count : -1;
|
int32 administrator_count = filter.is_administrators() ? total_count : -1;
|
||||||
|
@ -498,16 +498,18 @@ class GetChannelMessagesQuery : public Td::ResultHandler {
|
|||||||
|
|
||||||
auto info = td->messages_manager_->on_get_messages(result_ptr.move_as_ok(), "GetChannelMessagesQuery");
|
auto info = td->messages_manager_->on_get_messages(result_ptr.move_as_ok(), "GetChannelMessagesQuery");
|
||||||
LOG_IF(ERROR, !info.is_channel_messages) << "Receive ordinary messages in GetChannelMessagesQuery";
|
LOG_IF(ERROR, !info.is_channel_messages) << "Receive ordinary messages in GetChannelMessagesQuery";
|
||||||
vector<MessageId> empty_message_ids;
|
if (!td->auth_manager_->is_bot()) { // bots can receive messageEmpty because of their privacy mode
|
||||||
for (auto &message : info.messages) {
|
vector<MessageId> empty_message_ids;
|
||||||
if (message->get_id() == telegram_api::messageEmpty::ID) {
|
for (auto &message : info.messages) {
|
||||||
auto message_id = MessagesManager::get_message_id(message, false);
|
if (message->get_id() == telegram_api::messageEmpty::ID) {
|
||||||
if (message_id.is_valid()) {
|
auto message_id = MessagesManager::get_message_id(message, false);
|
||||||
empty_message_ids.push_back(message_id);
|
if (message_id.is_valid()) {
|
||||||
|
empty_message_ids.push_back(message_id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
td->messages_manager_->on_get_empty_messages(DialogId(channel_id_), std::move(empty_message_ids));
|
||||||
}
|
}
|
||||||
td->messages_manager_->on_get_empty_messages(DialogId(channel_id_), std::move(empty_message_ids));
|
|
||||||
td->messages_manager_->get_channel_difference_if_needed(
|
td->messages_manager_->get_channel_difference_if_needed(
|
||||||
DialogId(channel_id_), std::move(info),
|
DialogId(channel_id_), std::move(info),
|
||||||
PromiseCreator::lambda(
|
PromiseCreator::lambda(
|
||||||
@ -7199,8 +7201,10 @@ void MessagesManager::add_pending_channel_update(DialogId dialog_id, tl_object_p
|
|||||||
LOG(INFO) << "Receive from " << source << " pending " << to_string(update);
|
LOG(INFO) << "Receive from " << source << " pending " << to_string(update);
|
||||||
CHECK(update != nullptr);
|
CHECK(update != nullptr);
|
||||||
if (dialog_id.get_type() != DialogType::Channel) {
|
if (dialog_id.get_type() != DialogType::Channel) {
|
||||||
LOG(ERROR) << "Receive channel update in invalid " << dialog_id << " from " << source << ": "
|
if (dialog_id != DialogId() || !td_->auth_manager_->is_bot()) {
|
||||||
<< oneline(to_string(update));
|
LOG(ERROR) << "Receive channel update in invalid " << dialog_id << " from " << source << ": "
|
||||||
|
<< oneline(to_string(update));
|
||||||
|
}
|
||||||
promise.set_value(Unit());
|
promise.set_value(Unit());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -32668,6 +32672,7 @@ void MessagesManager::delete_message_from_database(Dialog *d, MessageId message_
|
|||||||
if (message_id.is_scheduled() && message_id.is_scheduled_server()) {
|
if (message_id.is_scheduled() && message_id.is_scheduled_server()) {
|
||||||
d->deleted_scheduled_server_message_ids.insert(message_id.get_scheduled_server_message_id());
|
d->deleted_scheduled_server_message_ids.insert(message_id.get_scheduled_server_message_id());
|
||||||
} else {
|
} else {
|
||||||
|
// don't store failed to send message identifiers for bots to reduce memory usage
|
||||||
if (m == nullptr || !td_->auth_manager_->is_bot() || !m->is_failed_to_send) {
|
if (m == nullptr || !td_->auth_manager_->is_bot() || !m->is_failed_to_send) {
|
||||||
d->deleted_message_ids.insert(message_id);
|
d->deleted_message_ids.insert(message_id);
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ class RequestActor : public Actor {
|
|||||||
bool is_authorized = td->auth_manager_ && td->auth_manager_->is_authorized();
|
bool is_authorized = td->auth_manager_ && td->auth_manager_->is_authorized();
|
||||||
if (is_authorized) {
|
if (is_authorized) {
|
||||||
LOG(ERROR) << "Promise was lost";
|
LOG(ERROR) << "Promise was lost";
|
||||||
do_send_error(Status::Error(500, "Query can't be answered due to bug in the TDLib"));
|
do_send_error(Status::Error(500, "Query can't be answered due to a bug in TDLib"));
|
||||||
} else {
|
} else {
|
||||||
do_send_error(Status::Error(401, "Unauthorized"));
|
do_send_error(Status::Error(401, "Unauthorized"));
|
||||||
}
|
}
|
||||||
|
@ -1003,7 +1003,9 @@ void WebPagesManager::on_load_web_page_instant_view_from_database(WebPageId web_
|
|||||||
|
|
||||||
void WebPagesManager::update_web_page_instant_view_load_requests(WebPageId web_page_id, bool force_update,
|
void WebPagesManager::update_web_page_instant_view_load_requests(WebPageId web_page_id, bool force_update,
|
||||||
Result<> result) {
|
Result<> result) {
|
||||||
// TODO [Error : 0 : Lost promise] on closing
|
if (G()->close_flag() && result.is_error()) {
|
||||||
|
result = Status::Error(500, "Request aborted");
|
||||||
|
}
|
||||||
LOG(INFO) << "Update load requests for " << web_page_id;
|
LOG(INFO) << "Update load requests for " << web_page_id;
|
||||||
auto it = load_web_page_instant_view_queries_.find(web_page_id);
|
auto it = load_web_page_instant_view_queries_.find(web_page_id);
|
||||||
if (it == load_web_page_instant_view_queries_.end()) {
|
if (it == load_web_page_instant_view_queries_.end()) {
|
||||||
|
@ -3816,6 +3816,22 @@ class CliClient final : public Actor {
|
|||||||
bool is_dark;
|
bool is_dark;
|
||||||
get_args(args, chat_id, is_dark);
|
get_args(args, chat_id, is_dark);
|
||||||
send_request(td_api::make_object<td_api::getChatStatistics>(as_chat_id(chat_id), is_dark));
|
send_request(td_api::make_object<td_api::getChatStatistics>(as_chat_id(chat_id), is_dark));
|
||||||
|
} else if (op == "sgs") {
|
||||||
|
string chat_id;
|
||||||
|
string message_id;
|
||||||
|
string user_id;
|
||||||
|
int32 score;
|
||||||
|
get_args(args, chat_id, message_id, user_id, score);
|
||||||
|
send_request(td_api::make_object<td_api::setGameScore>(as_chat_id(chat_id), as_message_id(message_id), true,
|
||||||
|
as_user_id(user_id), score, true));
|
||||||
|
} else if (op == "gghs") {
|
||||||
|
string chat_id;
|
||||||
|
string message_id;
|
||||||
|
string user_id;
|
||||||
|
int32 score;
|
||||||
|
get_args(args, chat_id, message_id, user_id, score);
|
||||||
|
send_request(td_api::make_object<td_api::getGameHighScores>(as_chat_id(chat_id), as_message_id(message_id),
|
||||||
|
as_user_id(user_id)));
|
||||||
} else if (op == "gmst") {
|
} else if (op == "gmst") {
|
||||||
string chat_id;
|
string chat_id;
|
||||||
string message_id;
|
string message_id;
|
||||||
|
Loading…
Reference in New Issue
Block a user