aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorlevlam <levlam@telegram.org>2020-12-08 03:29:19 +0300
committerlevlam <levlam@telegram.org>2020-12-08 03:29:19 +0300
commite184e6c117ef18bb7114429cce11afc87914c362 (patch)
tree140a4ae49862596133cb27c674867037c710baaa
parente2ae8dad02a7c0046e162e12bc0c0c077fff5d14 (diff)
Update TDLib. Support can_manage_voice_chats administrator right.
m---------td0
-rw-r--r--telegram-bot-api/Client.cpp22
-rw-r--r--telegram-bot-api/telegram-bot-api.cpp1
3 files changed, 20 insertions, 3 deletions
diff --git a/td b/td
-Subproject eb80924dad30af4e6d8385d058bb7e847174df5
+Subproject db3875710bcf9f29baa360d91d7b11b0199229a
diff --git a/telegram-bot-api/Client.cpp b/telegram-bot-api/Client.cpp
index e45d86b..cc46212 100644
--- a/telegram-bot-api/Client.cpp
+++ b/telegram-bot-api/Client.cpp
@@ -13,6 +13,7 @@
#include "td/db/TQueue.h"
+#include "td/utils/algorithm.h"
#include "td/utils/base64.h"
#include "td/utils/filesystem.h"
#include "td/utils/HttpUrl.h"
@@ -1746,6 +1747,12 @@ void Client::JsonMessage::store(JsonValueScope *scope) const {
object("proximity_alert_triggered", JsonProximityAlertTriggered(content, client_));
break;
}
+ case td_api::messageVoiceChatStarted::ID:
+ break;
+ case td_api::messageVoiceChatEnded::ID:
+ break;
+ case td_api::messageInviteVoiceChatParticipants::ID:
+ break;
default:
UNREACHABLE();
}
@@ -2056,6 +2063,7 @@ class Client::JsonChatMember : public Jsonable {
object("can_pin_messages", td::JsonBool(administrator->can_pin_messages_));
}
object("can_promote_members", td::JsonBool(administrator->can_promote_members_));
+ object("can_manage_voice_chats", td::JsonBool(administrator->can_manage_voice_chats_));
if (!administrator->custom_title_.empty()) {
object("custom_title", administrator->custom_title_);
}
@@ -5021,7 +5029,7 @@ td::Result<td_api::object_ptr<td_api::InputInlineQueryResult>> Client::get_inlin
TRY_RESULT(sticker_file_id, get_json_object_string_field(object, "sticker_file_id", false));
if (input_message_content == nullptr) {
- input_message_content = make_object<td_api::inputMessageSticker>(nullptr, nullptr, 0, 0);
+ input_message_content = make_object<td_api::inputMessageSticker>(nullptr, nullptr, 0, 0, td::string());
}
return make_object<td_api::inputInlineQueryResultSticker>(id, "", sticker_file_id, 0, 0, std::move(reply_markup),
std::move(input_message_content));
@@ -6021,7 +6029,8 @@ td::Status Client::process_send_sticker_query(PromisedQueryPtr &query) {
if (sticker == nullptr) {
return Status::Error(400, "There is no sticker in the request");
}
- do_send_message(make_object<td_api::inputMessageSticker>(std::move(sticker), nullptr, 0, 0), std::move(query));
+ do_send_message(make_object<td_api::inputMessageSticker>(std::move(sticker), nullptr, 0, 0, td::string()),
+ std::move(query));
return Status::OK();
}
@@ -6897,10 +6906,11 @@ td::Status Client::process_promote_chat_member_query(PromisedQueryPtr &query) {
auto can_restrict_members = to_bool(query->arg("can_restrict_members"));
auto can_pin_messages = to_bool(query->arg("can_pin_messages"));
auto can_promote_members = to_bool(query->arg("can_promote_members"));
+ auto can_manage_voice_chats = to_bool(query->arg("can_manage_voice_chats"));
auto is_anonymous = to_bool(query->arg("is_anonymous"));
auto status = make_object<td_api::chatMemberStatusAdministrator>(
td::string(), true, can_change_info, can_post_messages, can_edit_messages, can_delete_messages, can_invite_users,
- can_restrict_members, can_pin_messages, can_promote_members, is_anonymous);
+ can_restrict_members, can_pin_messages, can_promote_members, can_manage_voice_chats, is_anonymous);
check_chat(chat_id, AccessRights::Write, std::move(query),
[this, user_id, status = std::move(status)](int64 chat_id, PromisedQueryPtr query) mutable {
auto chat_info = get_chat(chat_id);
@@ -8391,6 +8401,12 @@ bool Client::need_skip_update_message(int64 chat_id, const object_ptr<td_api::me
return true;
case td_api::messageCustomServiceAction::ID:
return true;
+ case td_api::messageVoiceChatStarted::ID:
+ return true;
+ case td_api::messageVoiceChatEnded::ID:
+ return true;
+ case td_api::messageInviteVoiceChatParticipants::ID:
+ return true;
default:
break;
}
diff --git a/telegram-bot-api/telegram-bot-api.cpp b/telegram-bot-api/telegram-bot-api.cpp
index cdfb4cf..4b58675 100644
--- a/telegram-bot-api/telegram-bot-api.cpp
+++ b/telegram-bot-api/telegram-bot-api.cpp
@@ -24,6 +24,7 @@
#include "td/actor/ConcurrentScheduler.h"
#include "td/actor/PromiseFuture.h"
+#include "td/utils/algorithm.h"
#include "td/utils/buffer.h"
#include "td/utils/common.h"
#include "td/utils/crypto.h"