Update TDLib to 1.8.11.

This commit is contained in:
levlam 2023-01-11 20:30:27 +03:00
parent a8f7f78fe1
commit c68f6a7a89
4 changed files with 26 additions and 11 deletions

2
td

@ -1 +1 @@
Subproject commit eeb73d4eb22d201655ed30e0e5b76ced3ef2323f Subproject commit 3179d35694a28267a0b6273fc9b5bdce3b6b1235

View File

@ -734,10 +734,12 @@ class Client::JsonChat final : public Jsonable {
} }
object("permissions", JsonChatPermissions(permissions)); object("permissions", JsonChatPermissions(permissions));
} }
auto everyone_is_administrator = permissions->can_send_messages_ && permissions->can_send_media_messages_ && auto everyone_is_administrator =
permissions->can_send_polls_ && permissions->can_send_other_messages_ && permissions->can_send_messages_ && permissions->can_send_audios_ && permissions->can_send_documents_ &&
permissions->can_add_web_page_previews_ && permissions->can_change_info_ && permissions->can_send_photos_ && permissions->can_send_videos_ && permissions->can_send_video_notes_ &&
permissions->can_invite_users_ && permissions->can_pin_messages_; permissions->can_send_voice_notes_ && permissions->can_send_polls_ &&
permissions->can_send_other_messages_ && permissions->can_add_web_page_previews_ &&
permissions->can_change_info_ && permissions->can_invite_users_ && permissions->can_pin_messages_;
object("all_members_are_administrators", td::JsonBool(everyone_is_administrator)); object("all_members_are_administrators", td::JsonBool(everyone_is_administrator));
photo = group_info->photo.get(); photo = group_info->photo.get();
break; break;
@ -2196,6 +2198,10 @@ void Client::JsonMessage::store(JsonValueScope *scope) const {
case td_api::messageBotWriteAccessAllowed::ID: case td_api::messageBotWriteAccessAllowed::ID:
object("write_access_allowed", JsonEmptyObject()); object("write_access_allowed", JsonEmptyObject());
break; break;
case td_api::messageUserShared::ID:
break;
case td_api::messageChatShared::ID:
break;
default: default:
UNREACHABLE(); UNREACHABLE();
} }
@ -6914,9 +6920,11 @@ td::Result<td_api::object_ptr<td_api::chatPermissions>> Client::get_chat_permiss
if (can_send_other_messages || can_add_web_page_previews) { if (can_send_other_messages || can_add_web_page_previews) {
can_send_media_messages = true; can_send_media_messages = true;
} }
return make_object<td_api::chatPermissions>(can_send_messages, can_send_media_messages, can_send_polls, return make_object<td_api::chatPermissions>(can_send_messages, can_send_media_messages, can_send_media_messages,
can_send_other_messages, can_add_web_page_previews, can_change_info, can_send_media_messages, can_send_media_messages, can_send_media_messages,
can_invite_users, can_pin_messages, can_manage_topics); can_send_media_messages, can_send_polls, can_send_other_messages,
can_add_web_page_previews, can_change_info, can_invite_users,
can_pin_messages, can_manage_topics);
} }
td::Result<td_api::object_ptr<td_api::InputMessageContent>> Client::get_input_media(const Query *query, td::Result<td_api::object_ptr<td_api::InputMessageContent>> Client::get_input_media(const Query *query,
@ -9975,8 +9983,11 @@ void Client::json_store_administrator_rights(td::JsonObjectScope &object, const
} }
void Client::json_store_permissions(td::JsonObjectScope &object, const td_api::chatPermissions *permissions) { void Client::json_store_permissions(td::JsonObjectScope &object, const td_api::chatPermissions *permissions) {
bool can_send_media_messages = permissions->can_send_audios_ || permissions->can_send_documents_ ||
permissions->can_send_photos_ || permissions->can_send_videos_ ||
permissions->can_send_video_notes_ || permissions->can_send_voice_notes_;
object("can_send_messages", td::JsonBool(permissions->can_send_messages_)); object("can_send_messages", td::JsonBool(permissions->can_send_messages_));
object("can_send_media_messages", td::JsonBool(permissions->can_send_media_messages_)); object("can_send_media_messages", td::JsonBool(can_send_media_messages));
object("can_send_polls", td::JsonBool(permissions->can_send_polls_)); object("can_send_polls", td::JsonBool(permissions->can_send_polls_));
object("can_send_other_messages", td::JsonBool(permissions->can_send_other_messages_)); object("can_send_other_messages", td::JsonBool(permissions->can_send_other_messages_));
object("can_add_web_page_previews", td::JsonBool(permissions->can_add_web_page_previews_)); object("can_add_web_page_previews", td::JsonBool(permissions->can_add_web_page_previews_));
@ -10454,6 +10465,10 @@ bool Client::need_skip_update_message(int64 chat_id, const object_ptr<td_api::me
return true; return true;
case td_api::messageSuggestProfilePhoto::ID: case td_api::messageSuggestProfilePhoto::ID:
return true; return true;
case td_api::messageUserShared::ID:
return true;
case td_api::messageChatShared::ID:
return true;
default: default:
break; break;
} }

View File

@ -382,7 +382,7 @@ PromisedQueryPtr ClientManager::get_webhook_restore_query(td::Slice token, td::S
td::vector<td::BufferSlice> containers; td::vector<td::BufferSlice> containers;
auto add_string = [&containers](td::Slice str) { auto add_string = [&containers](td::Slice str) {
containers.emplace_back(str); containers.emplace_back(str);
return containers.back().as_slice(); return containers.back().as_mutable_slice();
}; };
token = add_string(token); token = add_string(token);

View File

@ -687,7 +687,7 @@ void WebhookActor::start_up() {
next_ip_address_resolve_time_ = last_success_time_ = td::Time::now() - 3600; next_ip_address_resolve_time_ = last_success_time_ = td::Time::now() - 3600;
active_new_connection_flood_.add_limit(1, 20); active_new_connection_flood_.add_limit(0.5, 10);
pending_new_connection_flood_.add_limit(2, 1); pending_new_connection_flood_.add_limit(2, 1);