Skip to content

Commit f5462e3

Browse files
committed
Update layer to 200.
1 parent 078444c commit f5462e3

File tree

10 files changed

+57
-40
lines changed

10 files changed

+57
-40
lines changed

td/generate/scheme/telegram_api.tl

Lines changed: 29 additions & 18 deletions
Large diffs are not rendered by default.

td/telegram/BusinessConnectionManager.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ class BusinessConnectionManager::SendBusinessMessageQuery final : public Td::Res
200200
false /*ignored*/, std::move(input_peer), std::move(reply_to),
201201
message_text->text, message_->random_id_,
202202
get_input_reply_markup(td_->user_manager_.get(), message_->reply_markup_),
203-
std::move(entities), 0, nullptr, nullptr, message_->effect_id_.get()),
203+
std::move(entities), 0, nullptr, nullptr, message_->effect_id_.get(), 0),
204204
td_->business_connection_manager_->get_business_connection_dc_id(message_->business_connection_id_),
205205
{{message_->dialog_id_}}));
206206
}
@@ -275,7 +275,7 @@ class BusinessConnectionManager::SendBusinessMediaQuery final : public Td::Resul
275275
std::move(input_peer), std::move(reply_to), std::move(input_media),
276276
message_text == nullptr ? string() : message_text->text, message_->random_id_,
277277
get_input_reply_markup(td_->user_manager_.get(), message_->reply_markup_),
278-
std::move(entities), 0, nullptr, nullptr, message_->effect_id_.get()),
278+
std::move(entities), 0, nullptr, nullptr, message_->effect_id_.get(), 0),
279279
td_->business_connection_manager_->get_business_connection_dc_id(message_->business_connection_id_),
280280
{{message_->dialog_id_}}));
281281
}
@@ -339,7 +339,7 @@ class BusinessConnectionManager::SendBusinessMultiMediaQuery final : public Td::
339339
telegram_api::messages_sendMultiMedia(
340340
flags, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/,
341341
false /*ignored*/, false /*ignored*/, std::move(input_peer), std::move(reply_to),
342-
std::move(input_single_media), 0, nullptr, nullptr, messages_[0]->effect_id_.get()),
342+
std::move(input_single_media), 0, nullptr, nullptr, messages_[0]->effect_id_.get(), 0),
343343
td_->business_connection_manager_->get_business_connection_dc_id(messages_[0]->business_connection_id_),
344344
{{messages_[0]->dialog_id_}}));
345345
}

td/telegram/GlobalPrivacySettings.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ telegram_api::object_ptr<telegram_api::globalPrivacySettings> GlobalPrivacySetti
140140
flags |= telegram_api::globalPrivacySettings::NEW_NONCONTACT_PEERS_REQUIRE_PREMIUM_MASK;
141141
}
142142
return telegram_api::make_object<telegram_api::globalPrivacySettings>(
143-
flags, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/);
143+
flags, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, 0);
144144
}
145145

146146
td_api::object_ptr<td_api::archiveChatListSettings> GlobalPrivacySettings::get_archive_chat_list_settings_object()

td/telegram/MessagesManager.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,7 +1221,7 @@ class SendMessageQuery final : public Td::ResultHandler {
12211221
false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/,
12221222
false /*ignored*/, std::move(input_peer), std::move(reply_to), text,
12231223
random_id, std::move(reply_markup), std::move(entities), schedule_date,
1224-
std::move(as_input_peer), nullptr, effect_id.get()),
1224+
std::move(as_input_peer), nullptr, effect_id.get(), 0),
12251225
{{dialog_id, MessageContentType::Text},
12261226
{dialog_id, is_copy ? MessageContentType::Photo : MessageContentType::Text}});
12271227
if (td_->option_manager_->get_option_boolean("use_quick_ack")) {
@@ -1355,7 +1355,7 @@ class SendInlineBotResultQuery final : public Td::ResultHandler {
13551355
auto query = G()->net_query_creator().create(
13561356
telegram_api::messages_sendInlineBotResult(
13571357
flags, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, std::move(input_peer),
1358-
std::move(reply_to), random_id, query_id, result_id, schedule_date, std::move(as_input_peer), nullptr),
1358+
std::move(reply_to), random_id, query_id, result_id, schedule_date, std::move(as_input_peer), nullptr, 0),
13591359
{{dialog_id, MessageContentType::Text}, {dialog_id, MessageContentType::Photo}});
13601360
auto send_query_ref = query.get_weak();
13611361
send_query(std::move(query));
@@ -1428,7 +1428,7 @@ class SendMultiMediaQuery final : public Td::ResultHandler {
14281428
telegram_api::messages_sendMultiMedia(
14291429
flags, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/,
14301430
false /*ignored*/, false /*ignored*/, std::move(input_peer), std::move(reply_to),
1431-
std::move(input_single_media), schedule_date, std::move(as_input_peer), nullptr, effect_id.get()),
1431+
std::move(input_single_media), schedule_date, std::move(as_input_peer), nullptr, effect_id.get(), 0),
14321432
{{dialog_id, is_copy ? MessageContentType::Text : MessageContentType::Photo},
14331433
{dialog_id, MessageContentType::Photo}}));
14341434
}
@@ -1569,7 +1569,7 @@ class SendMediaQuery final : public Td::ResultHandler {
15691569
false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/,
15701570
std::move(input_peer), std::move(reply_to), std::move(input_media), text,
15711571
random_id, std::move(reply_markup), std::move(entities), schedule_date,
1572-
std::move(as_input_peer), nullptr, effect_id.get()),
1572+
std::move(as_input_peer), nullptr, effect_id.get(), 0),
15731573
{{dialog_id, content_type}, {dialog_id, is_copy ? MessageContentType::Text : content_type}});
15741574
if (td_->option_manager_->get_option_boolean("use_quick_ack") && was_uploaded_) {
15751575
query->quick_ack_promise_ = PromiseCreator::lambda([random_id](Result<Unit> result) {
@@ -1936,7 +1936,7 @@ class ForwardMessagesQuery final : public Td::ResultHandler {
19361936
false /*ignored*/, false /*ignored*/, std::move(from_input_peer),
19371937
MessageId::get_server_message_ids(message_ids), std::move(random_ids), std::move(to_input_peer),
19381938
top_thread_message_id.get_server_message_id().get(), schedule_date, std::move(as_input_peer), nullptr,
1939-
new_video_start_timestamp),
1939+
new_video_start_timestamp, 0),
19401940
{{to_dialog_id, MessageContentType::Text}, {to_dialog_id, MessageContentType::Photo}});
19411941
if (td_->option_manager_->get_option_boolean("use_quick_ack")) {
19421942
query->quick_ack_promise_ = PromiseCreator::lambda([random_ids = random_ids_](Result<Unit> result) {

td/telegram/NotificationManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2915,7 +2915,7 @@ void NotificationManager::add_push_notification_user(
29152915
false /*ignored*/, 0, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/,
29162916
false /*ignored*/, false /*ignored*/, false /*ignored*/, sender_user_id.get(), sender_access_hash, user_name,
29172917
string(), string(), string(), std::move(sender_photo), nullptr, 0, Auto(), string(), string(), nullptr,
2918-
vector<telegram_api::object_ptr<telegram_api::username>>(), 0, nullptr, nullptr, 0, 0);
2918+
vector<telegram_api::object_ptr<telegram_api::username>>(), 0, nullptr, nullptr, 0, 0, 0);
29192919
td_->user_manager_->on_get_user(std::move(user), "add_push_notification_user");
29202920
}
29212921

td/telegram/QuickReplyManager.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ class QuickReplyManager::SendQuickReplyMessageQuery final : public Td::ResultHan
269269
false /*ignored*/, false /*ignored*/, false /*ignored*/,
270270
telegram_api::make_object<telegram_api::inputPeerSelf>(), std::move(reply_to), message_text->text,
271271
m->random_id, nullptr, std::move(entities), 0, nullptr,
272-
td_->quick_reply_manager_->get_input_quick_reply_shortcut(m->shortcut_id), 0),
272+
td_->quick_reply_manager_->get_input_quick_reply_shortcut(m->shortcut_id), 0, 0),
273273
{{"me"}}));
274274
}
275275

@@ -319,7 +319,7 @@ class QuickReplyManager::SendQuickReplyInlineMessageQuery final : public Td::Res
319319
flags, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/,
320320
telegram_api::make_object<telegram_api::inputPeerSelf>(), std::move(reply_to), m->random_id,
321321
m->inline_query_id, m->inline_result_id, 0, nullptr,
322-
td_->quick_reply_manager_->get_input_quick_reply_shortcut(m->shortcut_id)),
322+
td_->quick_reply_manager_->get_input_quick_reply_shortcut(m->shortcut_id), 0),
323323
{{"me"}}));
324324
}
325325

@@ -393,7 +393,7 @@ class QuickReplyManager::SendQuickReplyMediaQuery final : public Td::ResultHandl
393393
false /*ignored*/, false /*ignored*/, telegram_api::make_object<telegram_api::inputPeerSelf>(),
394394
std::move(reply_to), std::move(input_media), message_text == nullptr ? string() : message_text->text,
395395
m->random_id, nullptr, std::move(entities), 0, nullptr,
396-
td_->quick_reply_manager_->get_input_quick_reply_shortcut(m->shortcut_id), 0),
396+
td_->quick_reply_manager_->get_input_quick_reply_shortcut(m->shortcut_id), 0, 0),
397397
{{"me"}}));
398398
}
399399

@@ -589,7 +589,7 @@ class QuickReplyManager::SendQuickReplyMultiMediaQuery final : public Td::Result
589589
flags, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/,
590590
false /*ignored*/, false /*ignored*/, telegram_api::make_object<telegram_api::inputPeerSelf>(),
591591
std::move(reply_to), std::move(input_single_media), 0, nullptr,
592-
td_->quick_reply_manager_->get_input_quick_reply_shortcut(shortcut_id_), 0),
592+
td_->quick_reply_manager_->get_input_quick_reply_shortcut(shortcut_id_), 0, 0),
593593
{{"me"}}));
594594
}
595595

td/telegram/UpdatesManager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,7 +1201,7 @@ void UpdatesManager::on_get_updates_impl(tl_object_ptr<telegram_api::Updates> up
12011201
make_tl_object<telegram_api::peerUser>(from_id), 0, make_tl_object<telegram_api::peerUser>(update->user_id_),
12021202
nullptr, std::move(update->fwd_from_), update->via_bot_id_, 0, std::move(update->reply_to_), update->date_,
12031203
update->message_, nullptr, nullptr, std::move(update->entities_), 0, 0, nullptr, 0, string(), 0, nullptr,
1204-
Auto(), update->ttl_period_, 0, 0, nullptr, 0);
1204+
Auto(), update->ttl_period_, 0, 0, nullptr, 0, 0);
12051205
on_pending_update(
12061206
make_tl_object<telegram_api::updateNewMessage>(std::move(message), update->pts_, update->pts_count_), 0,
12071207
std::move(promise), "telegram_api::updateShortMessage");
@@ -1216,7 +1216,7 @@ void UpdatesManager::on_get_updates_impl(tl_object_ptr<telegram_api::Updates> up
12161216
make_tl_object<telegram_api::peerChat>(update->chat_id_), nullptr, std::move(update->fwd_from_),
12171217
update->via_bot_id_, 0, std::move(update->reply_to_), update->date_, update->message_, nullptr, nullptr,
12181218
std::move(update->entities_), 0, 0, nullptr, 0, string(), 0, nullptr, Auto(), update->ttl_period_, 0, 0,
1219-
nullptr, 0);
1219+
nullptr, 0, 0);
12201220
on_pending_update(
12211221
make_tl_object<telegram_api::updateNewMessage>(std::move(message), update->pts_, update->pts_count_), 0,
12221222
std::move(promise), "telegram_api::updateShortChatMessage");

td/telegram/UserManager.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,17 +1400,20 @@ class GetIsPremiumRequiredToContactQuery final : public Td::ResultHandler {
14001400

14011401
void send(vector<UserId> &&user_ids, vector<telegram_api::object_ptr<telegram_api::InputUser>> &&input_users) {
14021402
user_ids_ = std::move(user_ids);
1403-
send_query(
1404-
G()->net_query_creator().create(telegram_api::users_getIsPremiumRequiredToContact(std::move(input_users))));
1403+
send_query(G()->net_query_creator().create(telegram_api::users_getRequirementsToContact(std::move(input_users))));
14051404
}
14061405

14071406
void on_result(BufferSlice packet) final {
1408-
auto result_ptr = fetch_result<telegram_api::users_getIsPremiumRequiredToContact>(packet);
1407+
auto result_ptr = fetch_result<telegram_api::users_getRequirementsToContact>(packet);
14091408
if (result_ptr.is_error()) {
14101409
return on_error(result_ptr.move_as_error());
14111410
}
14121411

1413-
td_->user_manager_->on_get_is_premium_required_to_contact_users(std::move(user_ids_), result_ptr.move_as_ok(),
1412+
auto ptr = result_ptr.move_as_ok();
1413+
LOG(INFO) << "Receive result for GetIsPremiumRequiredToContactQuery: " << to_string(ptr);
1414+
auto result =
1415+
transform(ptr, [](const auto &req) { return req->get_id() == telegram_api::requirementToContactPremium::ID; });
1416+
td_->user_manager_->on_get_is_premium_required_to_contact_users(std::move(user_ids_), std::move(result),
14141417
std::move(promise_));
14151418
}
14161419

@@ -4206,7 +4209,7 @@ UserManager::User *UserManager::get_user_force(UserId user_id, const char *sourc
42064209
false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, user_id.get(), 1,
42074210
first_name, string(), username, phone_number, std::move(profile_photo), nullptr, bot_info_version, Auto(),
42084211
string(), string(), nullptr, vector<telegram_api::object_ptr<telegram_api::username>>(), 0, nullptr, nullptr, 0,
4209-
0);
4212+
0, 0);
42104213
on_get_user(std::move(user), "get_user_force");
42114214
u = get_user(user_id);
42124215
CHECK(u != nullptr && u->is_received);

td/telegram/UserPrivacySetting.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ UserPrivacySetting::UserPrivacySetting(const telegram_api::PrivacyKey &key) {
5454
case telegram_api::privacyKeyStarGiftsAutoSave::ID:
5555
type_ = Type::StarGiftAutosave;
5656
break;
57+
case telegram_api::privacyKeyNoPaidMessages::ID:
58+
type_ = Type::StarGiftAutosave;
59+
break;
5760
default:
5861
UNREACHABLE();
5962
type_ = Type::UserStatus;

td/telegram/Version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
namespace td {
1212

13-
constexpr int32 MTPROTO_LAYER = 199;
13+
constexpr int32 MTPROTO_LAYER = 200;
1414

1515
enum class Version : int32 {
1616
Initial, // 0

0 commit comments

Comments
 (0)