Update layer to 159.

This commit is contained in:
levlam 2023-04-25 14:27:58 +03:00
parent 66234ae253
commit 48d72677d3
6 changed files with 52 additions and 34 deletions

View File

@ -361,7 +361,7 @@ updateDeleteScheduledMessages#90866cee peer:Peer messages:Vector<int> = Update;
updateTheme#8216fba3 theme:Theme = Update;
updateGeoLiveViewed#871fb939 peer:Peer msg_id:int = Update;
updateLoginToken#564fe691 = Update;
updateMessagePollVote#106395c9 poll_id:long user_id:long options:Vector<bytes> qts:int = Update;
updateMessagePollVote#24f40e77 poll_id:long peer:Peer options:Vector<bytes> qts:int = Update;
updateDialogFilter#26ffde7d flags:# id:int filter:flags.0?DialogFilter = Update;
updateDialogFilterOrder#a5d72105 order:Vector<int> = Update;
updateDialogFilters#3504914f = Update;
@ -505,6 +505,7 @@ inputPrivacyKeyProfilePhoto#5719bacc = InputPrivacyKey;
inputPrivacyKeyPhoneNumber#352dafa = InputPrivacyKey;
inputPrivacyKeyAddedByPhone#d1219bdd = InputPrivacyKey;
inputPrivacyKeyVoiceMessages#aee69d68 = InputPrivacyKey;
inputPrivacyKeyAbout#3823cc40 = InputPrivacyKey;
privacyKeyStatusTimestamp#bc2eab30 = PrivacyKey;
privacyKeyChatInvite#500e6dfa = PrivacyKey;
@ -515,6 +516,7 @@ privacyKeyProfilePhoto#96151fed = PrivacyKey;
privacyKeyPhoneNumber#d19ae46d = PrivacyKey;
privacyKeyAddedByPhone#42ffd42b = PrivacyKey;
privacyKeyVoiceMessages#697f414 = PrivacyKey;
privacyKeyAbout#a486b761 = PrivacyKey;
inputPrivacyValueAllowContacts#d09e07b = InputPrivacyRule;
inputPrivacyValueAllowAll#184b35ce = InputPrivacyRule;
@ -1126,7 +1128,7 @@ poll#86e18161 id:long flags:# closed:flags.0?true public_voters:flags.1?true mul
pollAnswerVoters#3b6ddad2 flags:# chosen:flags.0?true correct:flags.1?true option:bytes voters:int = PollAnswerVoters;
pollResults#dcb82ea3 flags:# min:flags.0?true results:flags.1?Vector<PollAnswerVoters> total_voters:flags.2?int recent_voters:flags.3?Vector<long> solution:flags.4?string solution_entities:flags.4?Vector<MessageEntity> = PollResults;
pollResults#7adf2420 flags:# min:flags.0?true results:flags.1?Vector<PollAnswerVoters> total_voters:flags.2?int recent_voters:flags.3?Vector<Peer> solution:flags.4?string solution_entities:flags.4?Vector<MessageEntity> = PollResults;
chatOnlines#f041e250 onlines:int = ChatOnlines;
@ -1147,7 +1149,7 @@ codeSettings#ad253d78 flags:# allow_flashcall:flags.0?true current_number:flags.
wallPaperSettings#1dc1bca4 flags:# blur:flags.1?true motion:flags.2?true background_color:flags.0?int second_background_color:flags.4?int third_background_color:flags.5?int fourth_background_color:flags.6?int intensity:flags.3?int rotation:flags.4?int = WallPaperSettings;
autoDownloadSettings#8efab953 flags:# disabled:flags.0?true video_preload_large:flags.1?true audio_preload_next:flags.2?true phonecalls_less_data:flags.3?true photo_size_max:int video_size_max:long file_size_max:long video_upload_maxbitrate:int = AutoDownloadSettings;
autoDownloadSettings#baa57628 flags:# disabled:flags.0?true video_preload_large:flags.1?true audio_preload_next:flags.2?true phonecalls_less_data:flags.3?true photo_size_max:int video_size_max:long file_size_max:long video_upload_maxbitrate:int small_queue_active_operations_max:int large_queue_active_operations_max:int = AutoDownloadSettings;
account.autoDownloadSettings#63cacf26 low:AutoDownloadSettings medium:AutoDownloadSettings high:AutoDownloadSettings = account.AutoDownloadSettings;
@ -1208,11 +1210,7 @@ themeSettings#fa58b6d4 flags:# message_colors_animated:flags.2?true base_theme:B
webPageAttributeTheme#54b56617 flags:# documents:flags.0?Vector<Document> settings:flags.1?ThemeSettings = WebPageAttribute;
messageUserVote#34d247b4 user_id:long option:bytes date:int = MessageUserVote;
messageUserVoteInputOption#3ca5b0ec user_id:long date:int = MessageUserVote;
messageUserVoteMultiple#8a65e557 user_id:long options:Vector<bytes> date:int = MessageUserVote;
messages.votesList#823f649 flags:# count:int votes:Vector<MessageUserVote> users:Vector<User> next_offset:flags.0?string = messages.VotesList;
messages.votesList#4899484e flags:# count:int votes:Vector<MessagePeerVote> chats:Vector<Chat> users:Vector<User> next_offset:flags.0?string = messages.VotesList;
bankCardOpenUrl#f568028a url:string name:string = BankCardOpenUrl;
@ -1337,7 +1335,7 @@ account.resetPasswordFailedWait#e3779861 retry_date:int = account.ResetPasswordR
account.resetPasswordRequestedWait#e9effc7d until_date:int = account.ResetPasswordResult;
account.resetPasswordOk#e926d63e = account.ResetPasswordResult;
sponsoredMessage#fc25b828 flags:# recommended:flags.5?true show_peer_photo:flags.6?true random_id:bytes from_id:flags.3?Peer chat_invite:flags.4?ChatInvite chat_invite_hash:flags.4?string channel_post:flags.2?int start_param:flags.0?string message:string entities:flags.1?Vector<MessageEntity> sponsor_info:flags.7?string additional_info:flags.8?string = SponsoredMessage;
sponsoredMessage#daafff6b flags:# recommended:flags.5?true show_peer_photo:flags.6?true random_id:bytes from_id:flags.3?Peer chat_invite:flags.4?ChatInvite chat_invite_hash:flags.4?string channel_post:flags.2?int start_param:flags.0?string webpage:flags.9?SponsoredWebPage message:string entities:flags.1?Vector<MessageEntity> sponsor_info:flags.7?string additional_info:flags.8?string = SponsoredMessage;
messages.sponsoredMessages#c9ee1d87 flags:# posts_between:flags.0?int messages:Vector<SponsoredMessage> chats:Vector<Chat> users:Vector<User> = messages.SponsoredMessages;
messages.sponsoredMessagesEmpty#1839490f = messages.SponsoredMessages;
@ -1369,7 +1367,7 @@ availableReaction#c077ec01 flags:# inactive:flags.0?true premium:flags.2?true re
messages.availableReactionsNotModified#9f071957 = messages.AvailableReactions;
messages.availableReactions#768e3aad hash:int reactions:Vector<AvailableReaction> = messages.AvailableReactions;
messagePeerReaction#8c79b63c flags:# big:flags.0?true unread:flags.1?true peer_id:Peer date:int reaction:Reaction = MessagePeerReaction;
messagePeerReaction#8c79b63c flags:# big:flags.0?true unread:flags.1?true my:flags.2?true peer_id:Peer date:int reaction:Reaction = MessagePeerReaction;
groupCallStreamChannel#80eb48af channel:int scale:int last_timestamp_ms:long = GroupCallStreamChannel;
@ -1534,6 +1532,12 @@ chatlists.chatlistUpdates#93bd878d missing_peers:Vector<Peer> chats:Vector<Chat>
bots.botInfo#e8a775b0 name:string about:string description:string = bots.BotInfo;
messagePeerVote#b6cc2d5c peer:Peer option:bytes date:int = MessagePeerVote;
messagePeerVoteInputOption#74cda504 peer:Peer date:int = MessagePeerVote;
messagePeerVoteMultiple#4628f6e6 peer:Peer options:Vector<bytes> date:int = MessagePeerVote;
sponsoredWebPage#3db8ec63 flags:# url:string site_name:string photo:flags.0?Photo = SponsoredWebPage;
---functions---
invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X;
@ -1654,6 +1658,7 @@ account.getDefaultGroupPhotoEmojis#915860ae hash:long = EmojiList;
account.getAutoSaveSettings#adcbbcda = account.AutoSaveSettings;
account.saveAutoSaveSettings#d69b8361 flags:# users:flags.0?true chats:flags.1?true broadcasts:flags.2?true peer:flags.3?InputPeer settings:AutoSaveSettings = Bool;
account.deleteAutoSaveExceptions#53bc0020 = Bool;
account.invalidateSignInCodes#ca8ae8ba codes:Vector<string> = Bool;
users.getUsers#d91a548 id:Vector<InputUser> = Vector<User>;
users.getFullUser#b60f5918 id:InputUser = users.UserFull;
@ -1759,7 +1764,6 @@ messages.setInlineGameScore#15ad9f64 flags:# edit_message:flags.0?true force:fla
messages.getGameHighScores#e822649d peer:InputPeer id:int user_id:InputUser = messages.HighScores;
messages.getInlineGameHighScores#f635e1b id:InputBotInlineMessageID user_id:InputUser = messages.HighScores;
messages.getCommonChats#e40ca104 user_id:InputUser max_id:long limit:int = messages.Chats;
messages.getAllChats#875f74be except_ids:Vector<long> = messages.Chats;
messages.getWebPage#32ca8f91 url:string hash:int = WebPage;
messages.toggleDialogPin#a731e257 flags:# pinned:flags.0?true peer:InputDialogPeer = Bool;
messages.reorderPinnedDialogs#3b1adf37 flags:# force:flags.0?true folder_id:int order:Vector<InputDialogPeer> = Bool;
@ -1873,7 +1877,7 @@ messages.requestAppWebView#8c5a3b3c flags:# write_allowed:flags.0?true peer:Inpu
messages.setChatWallPaper#8ffacae1 flags:# peer:InputPeer wallpaper:flags.0?InputWallPaper settings:flags.2?WallPaperSettings id:flags.1?int = Updates;
updates.getState#edd4882a = updates.State;
updates.getDifference#25939651 flags:# pts:int pts_total_limit:flags.0?int date:int qts:int = updates.Difference;
updates.getDifference#19c2f763 flags:# pts:int pts_limit:flags.1?int pts_total_limit:flags.0?int date:int qts:int qts_limit:flags.2?int = updates.Difference;
updates.getChannelDifference#3173d78 flags:# force:flags.0?true channel:InputChannel filter:ChannelMessagesFilter pts:int limit:int = updates.ChannelDifference;
photos.updateProfilePhoto#9e82039 flags:# fallback:flags.0?true bot:flags.1?InputUser id:InputPhoto = photos.Photo;
@ -1970,6 +1974,7 @@ channels.reorderPinnedForumTopics#2950a18f flags:# force:flags.0?true channel:In
channels.toggleAntiSpam#68f3e4eb channel:InputChannel enabled:Bool = Updates;
channels.reportAntiSpamFalsePositive#a850a693 channel:InputChannel msg_id:int = Bool;
channels.toggleParticipantsHidden#6a6e7854 channel:InputChannel enabled:Bool = Updates;
channels.clickSponsoredMessage#18afbc93 channel:InputChannel random_id:bytes = Bool;
bots.sendCustomRequest#aa2769ed custom_method:string params:DataJSON = DataJSON;
bots.answerWebhookJSONQuery#e6213f4d query_id:long data:DataJSON = Bool;

View File

@ -81,7 +81,7 @@ telegram_api::object_ptr<telegram_api::autoDownloadSettings> get_input_auto_down
}
return telegram_api::make_object<telegram_api::autoDownloadSettings>(
flags, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, settings.max_photo_file_size,
settings.max_video_file_size, settings.max_other_file_size, settings.video_upload_bitrate);
settings.max_video_file_size, settings.max_other_file_size, settings.video_upload_bitrate, 0, 0);
}
class SaveAutoDownloadSettingsQuery final : public Td::ResultHandler {

View File

@ -1114,6 +1114,7 @@ void PollManager::on_get_poll_voters(PollId poll_id, int32 option_id, string off
auto vote_list = result.move_as_ok();
td_->contacts_manager_->on_get_users(std::move(vote_list->users_), "on_get_poll_voters");
td_->contacts_manager_->on_get_chats(std::move(vote_list->chats_), "on_get_poll_voters");
voters.next_offset_ = std::move(vote_list->next_offset_);
if (poll->options_[option_id].voter_count_ != vote_list->count_) {
@ -1122,39 +1123,41 @@ void PollManager::on_get_poll_voters(PollId poll_id, int32 option_id, string off
}
vector<UserId> user_ids;
for (auto &user_vote : vote_list->votes_) {
UserId user_id;
switch (user_vote->get_id()) {
case telegram_api::messageUserVote::ID: {
auto voter = telegram_api::move_object_as<telegram_api::messageUserVote>(user_vote);
for (auto &peer_vote : vote_list->votes_) {
DialogId dialog_id;
switch (peer_vote->get_id()) {
case telegram_api::messagePeerVote::ID: {
auto voter = telegram_api::move_object_as<telegram_api::messagePeerVote>(peer_vote);
if (voter->option_ != poll->options_[option_id].data_) {
continue;
}
user_id = UserId(voter->user_id_);
dialog_id = DialogId(voter->peer_);
break;
}
case telegram_api::messageUserVoteInputOption::ID: {
auto voter = telegram_api::move_object_as<telegram_api::messageUserVoteInputOption>(user_vote);
user_id = UserId(voter->user_id_);
case telegram_api::messagePeerVoteInputOption::ID: {
auto voter = telegram_api::move_object_as<telegram_api::messagePeerVoteInputOption>(peer_vote);
dialog_id = DialogId(voter->peer_);
break;
}
case telegram_api::messageUserVoteMultiple::ID: {
auto voter = telegram_api::move_object_as<telegram_api::messageUserVoteMultiple>(user_vote);
case telegram_api::messagePeerVoteMultiple::ID: {
auto voter = telegram_api::move_object_as<telegram_api::messagePeerVoteMultiple>(peer_vote);
if (!td::contains(voter->options_, poll->options_[option_id].data_)) {
continue;
}
user_id = UserId(voter->user_id_);
dialog_id = DialogId(voter->peer_);
break;
}
default:
UNREACHABLE();
}
if (user_id.is_valid()) {
user_ids.push_back(user_id);
if (dialog_id.is_valid()) {
if (dialog_id.get_type() == DialogType::User) {
user_ids.push_back(dialog_id.get_user_id());
}
} else {
LOG(ERROR) << "Receive " << user_id << " as voter in " << poll_id;
LOG(ERROR) << "Receive " << dialog_id << " as voter in " << poll_id;
}
}
append(voters.voter_user_ids_, user_ids);
@ -1771,8 +1774,12 @@ PollId PollManager::on_get_poll(PollId poll_id, tl_object_ptr<telegram_api::poll
vector<UserId> recent_voter_user_ids;
if (!is_bot) {
for (auto &user_id_int : poll_results->recent_voters_) {
UserId user_id(user_id_int);
for (auto &peer_id : poll_results->recent_voters_) {
DialogId dialog_id(peer_id);
if (dialog_id.get_type() != DialogType::User) {
continue;
}
auto user_id = dialog_id.get_user_id();
if (user_id.is_valid()) {
recent_voter_user_ids.push_back(user_id);
} else {

View File

@ -61,6 +61,9 @@ PrivacyManager::UserPrivacySetting::UserPrivacySetting(const telegram_api::Priva
case telegram_api::privacyKeyVoiceMessages::ID:
type_ = Type::VoiceMessages;
break;
case telegram_api::privacyKeyAbout::ID:
type_ = Type::VoiceMessages;
break;
default:
UNREACHABLE();
type_ = Type::UserStatus;

View File

@ -162,7 +162,7 @@ class GetDifferenceQuery final : public Td::ResultHandler {
}
void send(int32 pts, int32 date, int32 qts) {
send_query(G()->net_query_creator().create(telegram_api::updates_getDifference(0, pts, 0, date, qts)));
send_query(G()->net_query_creator().create(telegram_api::updates_getDifference(0, pts, 0, 0, date, qts, 0)));
}
void on_result(BufferSlice packet) final {
@ -2686,8 +2686,11 @@ void UpdatesManager::process_qts_update(tl_object_ptr<telegram_api::Update> &&up
}
case telegram_api::updateMessagePollVote::ID: {
auto update = move_tl_object_as<telegram_api::updateMessagePollVote>(update_ptr);
td_->poll_manager_->on_get_poll_vote(PollId(update->poll_id_), UserId(update->user_id_),
std::move(update->options_));
DialogId dialog_id(update->peer_);
if (dialog_id.get_type() == DialogType::User) {
td_->poll_manager_->on_get_poll_vote(PollId(update->poll_id_), dialog_id.get_user_id(),
std::move(update->options_));
}
add_qts(qts).set_value(Unit());
break;
}

View File

@ -10,7 +10,7 @@
namespace td {
constexpr int32 MTPROTO_LAYER = 158;
constexpr int32 MTPROTO_LAYER = 159;
enum class Version : int32 {
Initial, // 0