Update to layer 102. Replace LinkState with is_contact/is_mutual_contact.

GitOrigin-RevId: 33061b18ac72711f4df168fb27497bccb36d3367
This commit is contained in:
levlam 2019-10-07 22:51:03 +03:00
parent 1b2e4c79f3
commit 99f4abb249
11 changed files with 125 additions and 255 deletions

View File

@ -264,18 +264,6 @@ profilePhoto id:int64 small:file big:file = ProfilePhoto;
chatPhoto small:file big:file = ChatPhoto;
//@class LinkState @description Represents the relationship between user A and user B. For incoming_link, user A is the current user; for outgoing_link, user B is the current user
//@description The phone number of user A is not known to user B
linkStateNone = LinkState;
//@description The phone number of user A is known but that number has not been saved to the contact list of user B
linkStateKnowsPhoneNumber = LinkState;
//@description The phone number of user A has been saved to the contact list of user B
linkStateIsContact = LinkState;
//@class UserType @description Represents the type of the user. The following types are possible: regular users, deleted users and bots
//@description A regular user
@ -302,13 +290,14 @@ botInfo description:string commands:vector<botCommand> = BotInfo;
//@description Represents a user @id User identifier @first_name First name of the user @last_name Last name of the user @username Username of the user
//@phone_number Phone number of the user @status Current online status of the user @profile_photo Profile photo of the user; may be null
//@outgoing_link Relationship from the current user to the other user @incoming_link Relationship from the other user to the current user
//@is_contact The user is a contact of the current user
//@is_mutual_contact The user is a contact of the current user and the current user is a contact of the user
//@is_verified True, if the user is verified @is_support True, if the user is Telegram support account
//@restriction_reason If non-empty, it contains the reason why access to this user must be restricted. The format of the string is "{type}: {description}".
//-{type} contains the type of the restriction and at least one of the suffixes "-all", "-ios", "-android", or "-wp", which describe the platforms on which access should be restricted. (For example, "terms-ios-android". {description} contains a human-readable description of the restriction, which can be shown to the user)
//@is_scam True, if many users reported this user as a scam
//@have_access If false, the user is inaccessible, and the only information known about the user is inside this class. It can't be passed to any method except GetUser @type Type of the user @language_code IETF language tag of the user's language; only available to bots
user id:int32 first_name:string last_name:string username:string phone_number:string status:UserStatus profile_photo:profilePhoto outgoing_link:LinkState incoming_link:LinkState is_verified:Bool is_support:Bool restriction_reason:string is_scam:Bool have_access:Bool type:UserType language_code:string = User;
user id:int32 first_name:string last_name:string username:string phone_number:string status:UserStatus profile_photo:profilePhoto is_contact:Bool is_mutual_contact:Bool is_verified:Bool is_support:Bool restriction_reason:string is_scam:Bool have_access:Bool type:UserType language_code:string = User;
//@description Contains full information about a user (except the full list of profile photos) @is_blocked True, if the user is blacklisted by the current user @can_be_called True, if the user can be called @has_private_calls True, if the user can't be called due to their privacy settings
//@bio A short user bio @share_text For bots, the text that is included with the link when users share the bot @group_in_common_count Number of group chats where both the other user and the current user are a member; 0 for the current user @bot_info If the user is a bot, information about the bot; may be null

Binary file not shown.

View File

@ -110,11 +110,11 @@ userStatusLastMonth#77ebc742 = UserStatus;
chatEmpty#9ba2d800 id:int = Chat;
chat#3bda1bde flags:# creator:flags.0?true kicked:flags.1?true left:flags.2?true deactivated:flags.5?true id:int title:string photo:ChatPhoto participants_count:int date:int version:int migrated_to:flags.6?InputChannel admin_rights:flags.14?ChatAdminRights default_banned_rights:flags.18?ChatBannedRights = Chat;
chatForbidden#7328bdb id:int title:string = Chat;
channel#4df30834 flags:# creator:flags.0?true left:flags.2?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true signatures:flags.11?true min:flags.12?true scam:flags.19?true has_link:flags.20?true id:int access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int version:int restriction_reason:flags.9?string admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int = Chat;
channel#4df30834 flags:# creator:flags.0?true left:flags.2?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true signatures:flags.11?true min:flags.12?true scam:flags.19?true has_link:flags.20?true has_geo:flags.21?true id:int access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int version:int restriction_reason:flags.9?string admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int = Chat;
channelForbidden#289da732 flags:# broadcast:flags.5?true megagroup:flags.8?true id:int access_hash:long title:string until_date:flags.16?int = Chat;
chatFull#1b7c9db3 flags:# can_set_username:flags.7?true id:int about:string participants:ChatParticipants chat_photo:flags.2?Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite bot_info:flags.3?Vector<BotInfo> pinned_msg_id:flags.6?int folder_id:flags.11?int = ChatFull;
channelFull#9882e516 flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_view_stats:flags.12?true id:int about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite bot_info:Vector<BotInfo> migrated_from_chat_id:flags.4?int migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.13?int pts:int = ChatFull;
channelFull#10916653 flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_view_stats:flags.12?true can_set_location:flags.16?true id:int about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite bot_info:Vector<BotInfo> migrated_from_chat_id:flags.4?int migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?int location:flags.15?ChannelLocation pts:int = ChatFull;
chatParticipant#c8d7493e user_id:int inviter_id:int date:int = ChatParticipant;
chatParticipantCreator#da13538a user_id:int = ChatParticipant;
@ -196,7 +196,7 @@ inputPeerNotifySettings#9c3d198e flags:# show_previews:flags.0?Bool silent:flags
peerNotifySettings#af509d20 flags:# show_previews:flags.0?Bool silent:flags.1?Bool mute_until:flags.2?int sound:flags.3?string = PeerNotifySettings;
peerSettings#818426cd flags:# report_spam:flags.0?true = PeerSettings;
peerSettings#818426cd flags:# report_spam:flags.0?true add_contact:flags.1?true block_contact:flags.2?true share_contact:flags.3?true need_contacts_exception:flags.4?true report_geo:flags.5?true = PeerSettings;
wallPaper#a437c3ed id:long flags:# creator:flags.0?true default:flags.1?true pattern:flags.3?true dark:flags.4?true access_hash:long slug:string document:Document settings:flags.2?WallPaperSettings = WallPaper;
@ -206,8 +206,9 @@ inputReportReasonPornography#2e59d922 = ReportReason;
inputReportReasonChildAbuse#adf44ee3 = ReportReason;
inputReportReasonOther#e1746d0a text:string = ReportReason;
inputReportReasonCopyright#9b89f93a = ReportReason;
inputReportReasonGeoIrrelevant#dbd4feed = ReportReason;
userFull#745559cc flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true user:User about:flags.1?string link:contacts.Link profile_photo:flags.2?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int = UserFull;
userFull#edf17c12 flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true user:User about:flags.1?string settings:PeerSettings profile_photo:flags.2?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int = UserFull;
contact#f911c994 user_id:int mutual:Bool = Contact;
@ -217,8 +218,6 @@ contactBlocked#561bc879 user_id:int date:int = ContactBlocked;
contactStatus#d3680c61 user_id:int status:UserStatus = ContactStatus;
contacts.link#3ace484c my_link:ContactLink foreign_link:ContactLink user:User = contacts.Link;
contacts.contactsNotModified#b74ba9d2 = contacts.Contacts;
contacts.contacts#eae87e42 contacts:Vector<Contact> saved_count:int users:Vector<User> = contacts.Contacts;
@ -269,7 +268,6 @@ updateChatParticipants#7761198 participants:ChatParticipants = Update;
updateUserStatus#1bfbd823 user_id:int status:UserStatus = Update;
updateUserName#a7332b73 user_id:int first_name:string last_name:string username:string = Update;
updateUserPhoto#95313b0c user_id:int date:int photo:UserProfilePhoto previous:Bool = Update;
updateContactLink#9d2e67c5 user_id:int my_link:ContactLink foreign_link:ContactLink = Update;
updateNewEncryptedMessage#12bcbd9a message:EncryptedMessage qts:int = Update;
updateEncryptedChatTyping#1710f156 chat_id:int = Update;
updateEncryption#b4a2e88d chat:EncryptedChat date:int = Update;
@ -330,6 +328,8 @@ updateChatPinnedMessage#e10db349 chat_id:int id:int version:int = Update;
updateMessagePoll#aca1657b flags:# poll_id:long poll:flags.0?Poll results:PollResults = Update;
updateChatDefaultBannedRights#54c01850 peer:Peer default_banned_rights:ChatBannedRights version:int = Update;
updateFolderPeers#19360dc0 folder_peers:Vector<FolderPeer> pts:int pts_count:int = Update;
updatePeerSettings#6a7e7366 peer:Peer settings:PeerSettings = Update;
updatePeerLocated#b4afcfb0 peers:Vector<PeerLocated> = Update;
updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;
@ -475,10 +475,6 @@ messages.allStickers#edfd405f hash:int sets:Vector<StickerSet> = messages.AllSti
messages.affectedMessages#84d19185 pts:int pts_count:int = messages.AffectedMessages;
contactLinkUnknown#5f4f9247 = ContactLink;
contactLinkNone#feedd3ad = ContactLink;
contactLinkContact#d502c2d0 = ContactLink;
webPageEmpty#eb1477e8 id:long = WebPage;
webPagePending#c586da1c id:long date:int = WebPage;
webPage#5f07b4bc flags:# id:long url:string display_url:string hash:int type:flags.0?string site_name:flags.1?string title:flags.2?string description:flags.3?string photo:flags.4?Photo embed_url:flags.5?string embed_type:flags.5?string embed_width:flags.6?int embed_height:flags.6?int duration:flags.7?int author:flags.8?string document:flags.9?Document cached_page:flags.10?Page = WebPage;
@ -838,6 +834,7 @@ channelAdminLogEventActionTogglePreHistoryHidden#5f5c95f1 new_value:Bool = Chann
channelAdminLogEventActionDefaultBannedRights#2df5fc0a prev_banned_rights:ChatBannedRights new_banned_rights:ChatBannedRights = ChannelAdminLogEventAction;
channelAdminLogEventActionStopPoll#8f079643 message:Message = ChannelAdminLogEventAction;
channelAdminLogEventActionChangeLinkedChat#a26f881b prev_value:int new_value:int = ChannelAdminLogEventAction;
channelAdminLogEventActionChangeLocation#e6b76ae prev_value:ChannelLocation new_value:ChannelLocation = ChannelAdminLogEventAction;
channelAdminLogEvent#3b5a3e40 id:long date:int user_id:int action:ChannelAdminLogEventAction = ChannelAdminLogEvent;
@ -1048,6 +1045,11 @@ urlAuthResultRequest#92d33a0e flags:# request_write_access:flags.0?true bot:User
urlAuthResultAccepted#8f8c0e4e url:string = UrlAuthResult;
urlAuthResultDefault#a9d6db1f = UrlAuthResult;
channelLocationEmpty#bfb5ad8b = ChannelLocation;
channelLocation#209b82db geo_point:GeoPoint address:string = ChannelLocation;
peerLocated#ca461b5d peer:Peer expires:int distance:int = PeerLocated;
---functions---
invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X;
@ -1138,8 +1140,7 @@ contacts.getContactIDs#2caa4a42 hash:int = Vector<int>;
contacts.getStatuses#c4a353ee = Vector<ContactStatus>;
contacts.getContacts#c023849f hash:int = contacts.Contacts;
contacts.importContacts#2c800be5 contacts:Vector<InputContact> = contacts.ImportedContacts;
contacts.deleteContact#8e953744 id:InputUser = contacts.Link;
contacts.deleteContacts#59ab389e id:Vector<InputUser> = Bool;
contacts.deleteContacts#96a0e00 id:Vector<InputUser> = Updates;
contacts.deleteByPhones#1013fd9e phones:Vector<string> = Bool;
contacts.block#332b49fc id:InputUser = Bool;
contacts.unblock#e54100bd id:InputUser = Bool;
@ -1151,6 +1152,8 @@ contacts.resetTopPeerRating#1ae373ac category:TopPeerCategory peer:InputPeer = B
contacts.resetSaved#879537f1 = Bool;
contacts.getSaved#82f1e39f = Vector<SavedContact>;
contacts.toggleTopPeers#8514bdda enabled:Bool = Bool;
contacts.addContact#e8f463d0 flags:# add_phone_privacy_exception:flags.0?true id:InputUser first_name:string last_name:string phone:string = Updates;
contacts.getLocated#a356056 geo_point:InputGeoPoint = Updates;
messages.getMessages#63c66506 id:Vector<InputMessage> = messages.Messages;
messages.getDialogs#a0ee3b73 flags:# exclude_pinned:flags.0?true folder_id:flags.1?int offset_date:int offset_id:int offset_peer:InputPeer limit:int hash:int = messages.Dialogs;
@ -1165,7 +1168,6 @@ messages.sendMessage#fa88427a flags:# no_webpage:flags.1?true silent:flags.5?tru
messages.sendMedia#b8d1262b flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> = Updates;
messages.forwardMessages#708e0195 flags:# silent:flags.5?true background:flags.6?true with_my_score:flags.8?true grouped:flags.9?true from_peer:InputPeer id:Vector<int> random_id:Vector<long> to_peer:InputPeer = Updates;
messages.reportSpam#cf1592db peer:InputPeer = Bool;
messages.hideReportSpam#a8f1709b peer:InputPeer = Bool;
messages.getPeerSettings#3672e09c peer:InputPeer = PeerSettings;
messages.report#bd82b658 peer:InputPeer id:Vector<int> reason:ReportReason = Bool;
messages.getChats#3c6aa187 id:Vector<int> = messages.Chats;
@ -1200,7 +1202,7 @@ messages.startBot#e6df7378 bot:InputUser peer:InputPeer random_id:long start_par
messages.getMessagesViews#c4c8a55d peer:InputPeer id:Vector<int> increment:Bool = Vector<int>;
messages.editChatAdmin#a9e69f2e chat_id:int user_id:InputUser is_admin:Bool = Bool;
messages.migrateChat#15a3b8e3 chat_id:int = Updates;
messages.searchGlobal#f79c611 q:string offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages;
messages.searchGlobal#bf7225a4 flags:# folder_id:flags.0?int q:string offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages;
messages.reorderStickerSets#78337739 flags:# masks:flags.0?true order:Vector<long> = Bool;
messages.getDocumentByHash#338e2464 sha256:bytes size:int mime_type:string = Document;
messages.searchGifs#bf9a776b q:string offset:int = messages.FoundGifs;
@ -1265,6 +1267,7 @@ messages.getEmojiURL#d5b10c26 lang_code:string = EmojiURL;
messages.getSearchCounters#732eef00 peer:InputPeer filters:Vector<MessagesFilter> = Vector<messages.SearchCounter>;
messages.requestUrlAuth#e33f5613 peer:InputPeer msg_id:int button_id:int = UrlAuthResult;
messages.acceptUrlAuth#f729ea98 flags:# write_allowed:flags.0?true peer:InputPeer msg_id:int button_id:int = UrlAuthResult;
messages.hidePeerSettingsBar#4facb138 peer:InputPeer = Bool;
updates.getState#edd4882a = updates.State;
updates.getDifference#25939651 flags:# pts:int pts_total_limit:flags.0?int date:int qts:int = updates.Difference;
@ -1313,7 +1316,7 @@ channels.getParticipants#123e05e9 channel:InputChannel filter:ChannelParticipant
channels.getParticipant#546dd7a6 channel:InputChannel user_id:InputUser = channels.ChannelParticipant;
channels.getChannels#a7f6bbb id:Vector<InputChannel> = messages.Chats;
channels.getFullChannel#8736a09 channel:InputChannel = messages.ChatFull;
channels.createChannel#f4893d7f flags:# broadcast:flags.0?true megagroup:flags.1?true title:string about:string = Updates;
channels.createChannel#3d5fb10f flags:# broadcast:flags.0?true megagroup:flags.1?true title:string about:string geo_point:flags.2?InputGeoPoint address:flags.2?string = Updates;
channels.editAdmin#70f893ba channel:InputChannel user_id:InputUser admin_rights:ChatAdminRights = Updates;
channels.editTitle#566decd0 channel:InputChannel title:string = Updates;
channels.editPhoto#f12e57c9 channel:InputChannel photo:InputChatPhoto = Updates;
@ -1325,7 +1328,7 @@ channels.inviteToChannel#199f3a6c channel:InputChannel users:Vector<InputUser> =
channels.deleteChannel#c0111fe3 channel:InputChannel = Updates;
channels.exportMessageLink#ceb77163 channel:InputChannel id:int grouped:Bool = ExportedMessageLink;
channels.toggleSignatures#1f69b606 channel:InputChannel enabled:Bool = Updates;
channels.getAdminedPublicChannels#8d8d82d7 = messages.Chats;
channels.getAdminedPublicChannels#f8b036af flags:# by_location:flags.0?true check_limit:flags.1?true = messages.Chats;
channels.editBanned#72796912 channel:InputChannel user_id:InputUser banned_rights:ChatBannedRights = Updates;
channels.getAdminLog#33ddf480 flags:# channel:InputChannel q:string events_filter:flags.0?ChannelAdminLogEventsFilter admins:flags.1?Vector<InputUser> max_id:long min_id:long limit:int = channels.AdminLogResults;
channels.setStickers#ea8ca4f9 channel:InputChannel stickerset:InputStickerSet = Bool;
@ -1335,6 +1338,8 @@ channels.togglePreHistoryHidden#eabbb94c channel:InputChannel enabled:Bool = Upd
channels.getLeftChannels#8341ecc0 offset:int = messages.Chats;
channels.getGroupsForDiscussion#f5dad378 = messages.Chats;
channels.setDiscussionGroup#40582bb2 broadcast:InputChannel group:InputChannel = Bool;
channels.editCreator#8f38cd1f channel:InputChannel user_id:InputUser password:InputCheckPasswordSRP = Updates;
channels.editLocation#58e63f6d channel:InputChannel geo_point:InputGeoPoint address:string = Bool;
bots.sendCustomRequest#aa2769ed custom_method:string params:DataJSON = DataJSON;
bots.answerWebhookJSONQuery#e6213f4d query_id:long data:DataJSON = Bool;

Binary file not shown.

View File

@ -588,14 +588,12 @@ class ImportContactsQuery : public Td::ResultHandler {
class DeleteContactsQuery : public Td::ResultHandler {
Promise<Unit> promise_;
vector<UserId> user_ids_;
public:
explicit DeleteContactsQuery(Promise<Unit> &&promise) : promise_(std::move(promise)) {
}
void send(vector<UserId> &&user_ids, vector<tl_object_ptr<telegram_api::InputUser>> &&input_users) {
user_ids_ = std::move(user_ids);
send_query(
G()->net_query_creator().create(create_storer(telegram_api::contacts_deleteContacts(std::move(input_users)))));
}
@ -606,12 +604,10 @@ class DeleteContactsQuery : public Td::ResultHandler {
return on_error(id, result_ptr.move_as_error());
}
bool result = result_ptr.ok();
if (!result) {
return on_error(id, Status::Error(500, "Some contacts can't be deleted"));
}
auto ptr = result_ptr.move_as_ok();
LOG(INFO) << "Receive result for DeleteContactsQuery: " << to_string(ptr);
td->updates_manager_->on_get_updates(std::move(ptr));
td->contacts_manager_->on_deleted_contacts(user_ids_);
promise_.set_value(Unit());
}
@ -2327,24 +2323,6 @@ class GetSupportUserQuery : public Td::ResultHandler {
}
};
StringBuilder &operator<<(StringBuilder &string_builder, ContactsManager::LinkState link_state) {
switch (link_state) {
case ContactsManager::LinkState::Unknown:
string_builder << "unknown";
break;
case ContactsManager::LinkState::None:
string_builder << "none";
break;
case ContactsManager::LinkState::KnowsPhoneNumber:
string_builder << "knows phone number";
break;
case ContactsManager::LinkState::Contact:
string_builder << "contact";
break;
}
return string_builder;
}
bool ContactsManager::UserFull::is_bot_info_expired(int32 bot_info_version) const {
return bot_info_version != -1 && (bot_info == nullptr || bot_info->version != bot_info_version);
}
@ -2483,18 +2461,6 @@ void ContactsManager::on_channel_unban_timeout(ChannelId channel_id) {
update_channel(c, channel_id); // always call, because in case of failure we need to reactivate timeout
}
template <class StorerT>
void ContactsManager::store_link_state(const LinkState &link_state, StorerT &storer) {
store(static_cast<uint32>(link_state), storer);
}
template <class ParserT>
void ContactsManager::parse_link_state(LinkState &link_state, ParserT &parser) {
uint32 link_state_uint32;
parse(link_state_uint32, parser);
link_state = static_cast<LinkState>(static_cast<uint8>(link_state_uint32));
}
template <class StorerT>
void ContactsManager::BotInfo::store(StorerT &storer) const {
using td::store;
@ -2541,6 +2507,7 @@ void ContactsManager::User::store(StorerT &storer) const {
bool has_language_code = !language_code.empty();
bool have_access_hash = access_hash != -1;
bool has_cache_version = cache_version != 0;
bool has_is_contact = true;
BEGIN_STORE_FLAGS();
STORE_FLAG(is_received);
STORE_FLAG(is_verified);
@ -2560,6 +2527,9 @@ void ContactsManager::User::store(StorerT &storer) const {
STORE_FLAG(is_min_access_hash);
STORE_FLAG(is_scam);
STORE_FLAG(has_cache_version);
STORE_FLAG(has_is_contact);
STORE_FLAG(is_contact);
STORE_FLAG(is_mutual_contact);
END_STORE_FLAGS();
store(first_name, storer);
if (has_last_name) {
@ -2575,8 +2545,6 @@ void ContactsManager::User::store(StorerT &storer) const {
if (has_photo) {
store(photo, storer);
}
store_link_state(inbound, storer);
store_link_state(outbound, storer);
store(was_online, storer);
if (is_restricted) {
store(restriction_reason, storer);
@ -2605,6 +2573,7 @@ void ContactsManager::User::parse(ParserT &parser) {
bool has_language_code;
bool have_access_hash;
bool has_cache_version;
bool has_is_contact;
BEGIN_PARSE_FLAGS();
PARSE_FLAG(is_received);
PARSE_FLAG(is_verified);
@ -2624,6 +2593,9 @@ void ContactsManager::User::parse(ParserT &parser) {
PARSE_FLAG(is_min_access_hash);
PARSE_FLAG(is_scam);
PARSE_FLAG(has_cache_version);
PARSE_FLAG(has_is_contact);
PARSE_FLAG(is_contact);
PARSE_FLAG(is_mutual_contact);
END_PARSE_FLAGS();
parse(first_name, parser);
if (has_last_name) {
@ -2642,8 +2614,17 @@ void ContactsManager::User::parse(ParserT &parser) {
if (has_photo) {
parse(photo, parser);
}
parse_link_state(inbound, parser);
parse_link_state(outbound, parser);
if (!has_is_contact) {
// enum class LinkState : uint8 { Unknown, None, KnowsPhoneNumber, Contact };
uint32 link_state_inbound;
uint32 link_state_outbound;
parse(link_state_inbound, parser);
parse(link_state_outbound, parser);
is_contact = link_state_outbound == 3;
is_mutual_contact = is_contact && link_state_inbound == 3;
}
parse(was_online, parser);
if (is_restricted) {
parse(restriction_reason, parser);
@ -3485,7 +3466,7 @@ bool ContactsManager::default_can_report_spam_in_secret_chat(SecretChatId secret
if (u == nullptr) {
return true;
}
if (u->outbound == LinkState::Contact) {
if (u->is_contact) {
return false;
}
return true;
@ -3939,7 +3920,7 @@ int32 ContactsManager::get_contacts_hash() {
CHECK(std::is_sorted(user_ids.begin(), user_ids.end()));
auto my_id = get_my_id();
const User *u = get_user_force(my_id);
if (u != nullptr && u->outbound == LinkState::Contact) {
if (u != nullptr && u->is_contact) {
user_ids.insert(std::upper_bound(user_ids.begin(), user_ids.end(), my_id.get()), my_id.get());
}
@ -4010,7 +3991,7 @@ void ContactsManager::remove_contacts(vector<UserId> user_ids, Promise<Unit> &&p
vector<tl_object_ptr<telegram_api::InputUser>> input_users;
for (auto &user_id : user_ids) {
const User *u = get_user(user_id);
if (u != nullptr && u->outbound == LinkState::Contact) {
if (u != nullptr && u->is_contact) {
auto input_user = get_input_user(user_id);
if (input_user != nullptr) {
to_delete_user_ids.push_back(user_id);
@ -4281,15 +4262,14 @@ void ContactsManager::on_update_contacts_reset() {
for (auto &p : users_) {
UserId user_id = p.first;
User u = &p.second;
bool is_contact = u->outbound == LinkState::Contact;
if (is_contact) {
if (u->is_contact) {
LOG(INFO) << "Drop contact with " << user_id;
if (user_id != my_id) {
CHECK(contacts_hints_.has_key(user_id.get()));
}
on_update_user_links(u, user_id, LinkState::KnowsPhoneNumber, u->inbound);
on_update_user_is_contact(u, user_id, false, false);
update_user(u, user_id);
CHECK(u->outbound != LinkState::Contact);
CHECK(!u->is_contact);
if (user_id != my_id) {
CHECK(!contacts_hints_.has_key(user_id.get()));
}
@ -5366,9 +5346,9 @@ void ContactsManager::on_deleted_contacts(const vector<UserId> &deleted_contact_
LOG(INFO) << "Drop contact with " << user_id;
auto u = get_user(user_id);
CHECK(u != nullptr);
on_update_user_links(u, user_id, LinkState::KnowsPhoneNumber, u->inbound);
on_update_user_is_contact(u, user_id, false, false);
update_user(u, user_id);
CHECK(u->outbound != LinkState::Contact);
CHECK(!u->is_contact);
CHECK(!contacts_hints_.has_key(user_id.get()));
}
}
@ -5409,18 +5389,17 @@ void ContactsManager::on_get_contacts(tl_object_ptr<telegram_api::contacts_Conta
for (auto &p : users_) {
UserId user_id = p.first;
User *u = &p.second;
bool is_contact = u->outbound == LinkState::Contact;
bool should_be_contact = contact_user_ids.count(user_id) == 1;
if (is_contact != should_be_contact) {
if (is_contact) {
if (u->is_contact != should_be_contact) {
if (u->is_contact) {
LOG(INFO) << "Drop contact with " << user_id;
if (user_id != my_id) {
LOG_CHECK(contacts_hints_.has_key(user_id.get()))
<< my_id << " " << user_id << " " << to_string(get_user_object(user_id, u));
}
on_update_user_links(u, user_id, LinkState::KnowsPhoneNumber, u->inbound);
on_update_user_is_contact(u, user_id, false, false);
update_user(u, user_id);
CHECK(u->outbound != LinkState::Contact);
CHECK(!u->is_contact);
if (user_id != my_id) {
CHECK(!contacts_hints_.has_key(user_id.get()));
}
@ -5522,12 +5501,6 @@ void ContactsManager::on_update_online_status_privacy() {
td_->create_handler<GetContactsStatusesQuery>()->send();
}
void ContactsManager::on_get_contacts_link(tl_object_ptr<telegram_api::contacts_link> &&link) {
UserId user_id = get_user_id(link->user_);
on_get_user(std::move(link->user_), "on_get_contacts_link");
on_update_user_links(user_id, std::move(link->my_link_), std::move(link->foreign_link_));
}
UserId ContactsManager::get_user_id(const tl_object_ptr<telegram_api::User> &user) {
CHECK(user != nullptr);
switch (user->get_id()) {
@ -5643,21 +5616,9 @@ void ContactsManager::on_get_user(tl_object_ptr<telegram_api::User> &&user_ptr,
if (is_received) {
on_update_user_online(u, user_id, std::move(user->status_));
LinkState out, in;
if (flags & USER_FLAG_IS_MUTUAL_CONTACT) {
out = LinkState::Contact;
in = LinkState::Contact;
} else if (flags & USER_FLAG_IS_CONTACT) {
out = LinkState::Contact;
in = LinkState::Unknown;
} else if (flags & USER_FLAG_HAS_PHONE_NUMBER) {
out = LinkState::KnowsPhoneNumber;
in = LinkState::Unknown;
} else {
out = LinkState::None;
in = LinkState::Unknown;
}
on_update_user_links(u, user_id, out, in);
auto is_contact = (flags & USER_FLAG_IS_CONTACT) != 0;
auto is_mutual_contact = (flags & USER_FLAG_IS_MUTUAL_CONTACT) != 0;
on_update_user_is_contact(u, user_id, is_contact, is_mutual_contact);
}
if (is_received || !u->is_received) {
@ -5875,7 +5836,7 @@ void ContactsManager::on_save_user_to_database(UserId user_id, bool success) {
<< u->is_deleted << " " << u->is_bot << " " << u->is_changed << " "
<< u->need_send_update << " " << u->is_status_changed << " " << u->is_name_changed << " "
<< u->is_username_changed << " " << u->is_photo_changed << " "
<< u->is_outbound_link_changed;
<< u->is_is_contact_changed;
CHECK(load_user_from_database_queries_.count(user_id) == 0);
u->is_being_saved = false;
@ -6911,7 +6872,7 @@ ContactsManager::ChannelFull *ContactsManager::get_channel_full_force(ChannelId
void ContactsManager::update_user(User *u, UserId user_id, bool from_binlog, bool from_database) {
CHECK(u != nullptr);
if (u->is_name_changed || u->is_username_changed || u->is_outbound_link_changed) {
if (u->is_name_changed || u->is_username_changed || u->is_is_contact_changed) {
update_contacts_hints(u, user_id, from_database);
}
if (u->is_name_changed) {
@ -6963,7 +6924,7 @@ void ContactsManager::update_user(User *u, UserId user_id, bool from_binlog, boo
u->is_name_changed = false;
u->is_username_changed = false;
u->is_photo_changed = false;
u->is_outbound_link_changed = false;
u->is_is_contact_changed = false;
u->is_default_permissions_changed = false;
if (u->is_deleted) {
@ -7291,7 +7252,6 @@ void ContactsManager::on_get_user_full(tl_object_ptr<telegram_api::userFull> &&u
return;
}
on_update_user_links(user_id, std::move(user_full->link_->my_link_), std::move(user_full->link_->foreign_link_));
td_->messages_manager_->on_update_dialog_notify_settings(DialogId(user_id), std::move(user_full->notify_settings_),
"on_get_user_full");
@ -7695,7 +7655,7 @@ void ContactsManager::on_get_chat_full(tl_object_ptr<telegram_api::ChatFull> &&c
bool ContactsManager::is_update_about_username_change_received(UserId user_id) const {
const User *u = get_user(user_id);
if (u != nullptr) {
return u->inbound == LinkState::Contact;
return u->is_contact;
} else {
return false;
}
@ -7830,6 +7790,26 @@ void ContactsManager::add_user_photo_id(User *u, UserId user_id, int64 photo_id,
}
}
void ContactsManager::on_update_user_is_contact(User *u, UserId user_id, bool is_contact, bool is_mutual_contact) {
UserId my_id = get_my_id();
if (user_id == my_id) {
is_mutual_contact = is_contact;
}
if (!is_contact && is_mutual_contact) {
LOG(ERROR) << "Receive is_mutual_contact == true for non-contact " << user_id;
is_mutual_contact = false;
}
if (u->is_contact != is_contact || u->is_mutual_contact != is_mutual_contact) {
LOG(DEBUG) << "Update " << user_id << " is_contact from (" << u->is_contact << ", " << u->is_mutual_contact
<< ") to (" << is_contact << ", " << is_mutual_contact << ")";
u->is_is_contact_changed |= (u->is_contact != is_contact);
u->is_contact = is_contact;
u->is_mutual_contact = is_mutual_contact;
u->need_send_update = true;
}
}
void ContactsManager::on_update_user_online(UserId user_id, tl_object_ptr<telegram_api::UserStatus> &&status) {
if (!user_id.is_valid()) {
LOG(ERROR) << "Receive invalid " << user_id;
@ -8024,77 +8004,6 @@ void ContactsManager::on_delete_profile_photo(int64 profile_photo_id, Promise<Un
reload_user(my_id, std::move(promise));
}
ContactsManager::LinkState ContactsManager::get_link_state(tl_object_ptr<telegram_api::ContactLink> &&link) {
int32 id = link->get_id();
switch (id) {
case telegram_api::contactLinkUnknown::ID:
return LinkState::Unknown;
case telegram_api::contactLinkNone::ID:
return LinkState::None;
case telegram_api::contactLinkContact::ID:
return LinkState::Contact;
default:
UNREACHABLE();
}
return LinkState::Unknown;
}
void ContactsManager::on_update_user_links(UserId user_id, tl_object_ptr<telegram_api::ContactLink> &&outbound,
tl_object_ptr<telegram_api::ContactLink> &&inbound) {
if (!user_id.is_valid()) {
LOG(ERROR) << "Receive invalid " << user_id;
return;
}
User *u = get_user_force(user_id);
if (u != nullptr) {
on_update_user_links(u, user_id, get_link_state(std::move(outbound)), get_link_state(std::move(inbound)));
update_user(u, user_id);
} else {
LOG(INFO) << "Ignore update user links about unknown " << user_id;
}
}
void ContactsManager::on_update_user_links(User *u, UserId user_id, LinkState outbound, LinkState inbound) {
UserId my_id = get_my_id();
if (user_id == my_id) {
if (outbound == LinkState::None && !td_->auth_manager_->is_bot()) {
outbound = LinkState::KnowsPhoneNumber;
}
inbound = outbound;
}
if (!u->phone_number.empty() && outbound == LinkState::None) {
outbound = LinkState::KnowsPhoneNumber;
}
LOG(DEBUG) << "Update " << user_id << " links from (" << u->outbound << ", " << u->inbound << ") to (" << outbound
<< ", " << inbound << ")";
bool need_send_update = false;
if (outbound != u->outbound && outbound != LinkState::Unknown) {
need_send_update |= outbound != LinkState::None || u->outbound != LinkState::Unknown;
LOG(DEBUG) << "Set outbound link to " << outbound << ", need_send_update = " << need_send_update;
u->outbound = outbound;
u->is_outbound_link_changed = true;
u->is_changed = true;
}
if (inbound != u->inbound && inbound != LinkState::Unknown) {
need_send_update |= inbound != LinkState::None || u->inbound != LinkState::Unknown;
LOG(DEBUG) << "Set inbound link to " << inbound << ", need_send_update = " << need_send_update;
u->inbound = inbound;
u->is_changed = true;
}
if (u->inbound == LinkState::Contact && u->outbound != LinkState::Contact) {
u->inbound = LinkState::KnowsPhoneNumber;
u->is_changed = true;
need_send_update = true;
}
if (need_send_update) {
LOG(DEBUG) << "Links have changed for " << user_id;
u->need_send_update = true;
}
}
void ContactsManager::drop_user_full(UserId user_id) {
auto user_full = get_user_full_force(user_id);
if (user_full == nullptr) {
@ -8433,7 +8342,7 @@ bool ContactsManager::is_user_contact(UserId user_id) const {
}
bool ContactsManager::is_user_contact(const User *u, UserId user_id) const {
return u != nullptr && u->outbound == LinkState::Contact && user_id != get_my_id();
return u != nullptr && u->is_contact && user_id != get_my_id();
}
void ContactsManager::on_get_channel_participants_success(
@ -11301,9 +11210,8 @@ int32 ContactsManager::get_user_id_object(UserId user_id, const char *source) co
send_closure(G()->td(), &Td::send_update,
td_api::make_object<td_api::updateUser>(td_api::make_object<td_api::user>(
user_id.get(), "", "", "", "", td_api::make_object<td_api::userStatusEmpty>(),
get_profile_photo_object(td_->file_manager_.get(), nullptr),
get_link_state_object(LinkState::Unknown), get_link_state_object(LinkState::Unknown), false, false,
"", false, false, td_api::make_object<td_api::userTypeUnknown>(), "")));
get_profile_photo_object(td_->file_manager_.get(), nullptr), false, false, false, false, "", false,
false, td_api::make_object<td_api::userTypeUnknown>(), "")));
}
return user_id.get();
}
@ -11326,11 +11234,11 @@ tl_object_ptr<td_api::user> ContactsManager::get_user_object(UserId user_id, con
type = make_tl_object<td_api::userTypeRegular>();
}
return make_tl_object<td_api::user>(
user_id.get(), u->first_name, u->last_name, u->username, u->phone_number, get_user_status_object(user_id, u),
get_profile_photo_object(td_->file_manager_.get(), &u->photo), get_link_state_object(u->outbound),
get_link_state_object(u->inbound), u->is_verified, u->is_support, u->restriction_reason, u->is_scam,
u->is_received, std::move(type), u->language_code);
return make_tl_object<td_api::user>(user_id.get(), u->first_name, u->last_name, u->username, u->phone_number,
get_user_status_object(user_id, u),
get_profile_photo_object(td_->file_manager_.get(), &u->photo), u->is_contact,
u->is_mutual_contact, u->is_verified, u->is_support, u->restriction_reason,
u->is_scam, u->is_received, std::move(type), u->language_code);
}
vector<int32> ContactsManager::get_user_ids_object(const vector<UserId> &user_ids) const {
@ -11498,21 +11406,6 @@ tl_object_ptr<td_api::secretChat> ContactsManager::get_secret_chat_object_const(
secret_chat->key_hash, secret_chat->layer);
}
tl_object_ptr<td_api::LinkState> ContactsManager::get_link_state_object(LinkState link) {
switch (link) {
case LinkState::Unknown:
case LinkState::None:
return make_tl_object<td_api::linkStateNone>();
case LinkState::KnowsPhoneNumber:
return make_tl_object<td_api::linkStateKnowsPhoneNumber>();
case LinkState::Contact:
return make_tl_object<td_api::linkStateIsContact>();
default:
UNREACHABLE();
}
return make_tl_object<td_api::linkStateNone>();
}
tl_object_ptr<td_api::botInfo> ContactsManager::get_bot_info_object(const BotInfo *bot_info) {
if (bot_info == nullptr) {
return nullptr;

View File

@ -132,8 +132,6 @@ class ContactsManager : public Actor {
void reload_contacts(bool force);
void on_get_contacts_link(tl_object_ptr<telegram_api::contacts_link> &&link);
void on_get_user(tl_object_ptr<telegram_api::User> &&user, const char *source, bool is_me = false,
bool expect_support = false);
void on_get_users(vector<tl_object_ptr<telegram_api::User>> &&users, const char *source);
@ -160,8 +158,6 @@ class ContactsManager : public Actor {
void on_update_user_photo(UserId user_id, tl_object_ptr<telegram_api::UserProfilePhoto> &&photo_ptr);
void on_update_user_online(UserId user_id, tl_object_ptr<telegram_api::UserStatus> &&status);
void on_update_user_local_was_online(UserId user_id, int32 local_was_online);
void on_update_user_links(UserId user_id, tl_object_ptr<telegram_api::ContactLink> &&outbound,
tl_object_ptr<telegram_api::ContactLink> &&inbound);
void on_update_user_blocked(UserId user_id, bool is_blocked);
void on_update_user_common_chat_count(UserId user_id, int32 common_chat_count);
@ -475,10 +471,6 @@ class ContactsManager : public Actor {
void get_current_state(vector<td_api::object_ptr<td_api::Update>> &updates) const;
private:
enum class LinkState : uint8 { Unknown, None, KnowsPhoneNumber, Contact };
friend StringBuilder &operator<<(StringBuilder &string_builder, LinkState link_state);
struct User {
string first_name;
string last_name;
@ -497,9 +489,6 @@ class ContactsManager : public Actor {
string language_code;
LinkState outbound = LinkState::Unknown;
LinkState inbound = LinkState::Unknown;
std::unordered_set<int64> photo_ids;
std::unordered_map<DialogId, int32, DialogIdHash> online_member_dialogs; // id -> time
@ -518,6 +507,8 @@ class ContactsManager : public Actor {
bool is_inline_bot = false;
bool need_location_bot = false;
bool is_scam = false;
bool is_contact = false;
bool is_mutual_contact = false;
bool is_photo_inited = false;
@ -526,7 +517,7 @@ class ContactsManager : public Actor {
bool is_name_changed = true;
bool is_username_changed = true;
bool is_photo_changed = true;
bool is_outbound_link_changed = true;
bool is_is_contact_changed = true;
bool is_default_permissions_changed = true;
bool is_changed = true; // have new changes not sent to the database except changes visible to the client
bool need_send_update = true; // have new changes not sent to the client
@ -939,8 +930,6 @@ class ContactsManager : public Actor {
void set_my_id(UserId my_id);
static LinkState get_link_state(tl_object_ptr<telegram_api::ContactLink> &&link);
static bool is_valid_username(const string &username);
bool on_update_bot_info(tl_object_ptr<telegram_api::botInfo> &&bot_info);
@ -949,9 +938,9 @@ class ContactsManager : public Actor {
void on_update_user_phone_number(User *u, UserId user_id, string &&phone_number);
void on_update_user_photo(User *u, UserId user_id, tl_object_ptr<telegram_api::UserProfilePhoto> &&photo,
const char *source);
void on_update_user_is_contact(User *u, UserId user_id, bool is_contact, bool is_mutual_contact);
void on_update_user_online(User *u, UserId user_id, tl_object_ptr<telegram_api::UserStatus> &&status);
void on_update_user_local_was_online(User *u, UserId user_id, int32 local_was_online);
void on_update_user_links(User *u, UserId user_id, LinkState outbound, LinkState inbound);
void do_update_user_photo(User *u, UserId user_id, tl_object_ptr<telegram_api::UserProfilePhoto> &&photo,
const char *source);
@ -1127,8 +1116,6 @@ class ContactsManager : public Actor {
tl_object_ptr<td_api::UserStatus> get_user_status_object(UserId user_id, const User *u) const;
static tl_object_ptr<td_api::LinkState> get_link_state_object(LinkState link);
static tl_object_ptr<td_api::botInfo> get_bot_info_object(const BotInfo *bot_info);
tl_object_ptr<td_api::user> get_user_object(UserId user_id, const User *u) const;
@ -1175,12 +1162,6 @@ class ContactsManager : public Actor {
void on_user_online_timeout(UserId user_id);
template <class StorerT>
static void store_link_state(const LinkState &link_state, StorerT &storer);
template <class ParserT>
static void parse_link_state(LinkState &link_state, ParserT &parser);
void tear_down() override;
Td *td_;

View File

@ -2663,13 +2663,6 @@ Status fix_formatted_text(string &text, vector<MessageEntity> &entities, bool al
entities = merge_entities(std::move(entities), find_entities(text, skip_bot_commands));
}
for (auto it = entities.begin(); it != entities.end(); ++it) {
CHECK(it->length > 0);
if (it + 1 != entities.end()) {
CHECK(it->offset + it->length <= (it + 1)->offset);
}
}
// TODO MAX_MESSAGE_LENGTH and MAX_CAPTION_LENGTH
return Status::OK();

View File

@ -599,8 +599,8 @@ class CreateChannelQuery : public Td::ResultHandler {
}
random_id_ = random_id;
send_query(G()->net_query_creator().create(create_storer(
telegram_api::channels_createChannel(flags, false /*ignored*/, false /*ignored*/, title, about))));
send_query(G()->net_query_creator().create(create_storer(telegram_api::channels_createChannel(
flags, false /*ignored*/, false /*ignored*/, title, about, nullptr, string()))));
}
void on_result(uint64 id, BufferSlice packet) override {
@ -1459,8 +1459,9 @@ class SearchMessagesGlobalQuery : public Td::ResultHandler {
input_peer = make_tl_object<telegram_api::inputPeerEmpty>();
}
send_query(G()->net_query_creator().create(create_storer(telegram_api::messages_searchGlobal(
query, offset_date_, std::move(input_peer), offset_message_id.get_server_message_id().get(), limit))));
send_query(G()->net_query_creator().create(create_storer(
telegram_api::messages_searchGlobal(0, false /*ignored*/, query, offset_date_, std::move(input_peer),
offset_message_id.get_server_message_id().get(), limit))));
}
void on_result(uint64 id, BufferSlice packet) override {
@ -3228,22 +3229,24 @@ class UpdatePeerSettingsQuery : public Td::ResultHandler {
send_query(
G()->net_query_creator().create(create_storer(telegram_api::messages_reportSpam(std::move(input_peer)))));
} else {
send_query(
G()->net_query_creator().create(create_storer(telegram_api::messages_hideReportSpam(std::move(input_peer)))));
send_query(G()->net_query_creator().create(
create_storer(telegram_api::messages_hidePeerSettingsBar(std::move(input_peer)))));
}
}
void on_result(uint64 id, BufferSlice packet) override {
static_assert(std::is_same<telegram_api::messages_reportSpam::ReturnType,
telegram_api::messages_hideReportSpam::ReturnType>::value,
telegram_api::messages_hidePeerSettingsBar::ReturnType>::value,
"");
auto result_ptr = fetch_result<telegram_api::messages_reportSpam>(packet);
if (result_ptr.is_error()) {
return on_error(id, result_ptr.move_as_error());
}
td->messages_manager_->on_get_peer_settings(dialog_id_,
make_tl_object<telegram_api::peerSettings>(0, false /*ignored*/));
td->messages_manager_->on_get_peer_settings(
dialog_id_,
make_tl_object<telegram_api::peerSettings>(0, false /*ignored*/, false /*ignored*/, false /*ignored*/,
false /*ignored*/, false /*ignored*/, false /*ignored*/));
promise_.set_value(Unit());
}
@ -3280,8 +3283,10 @@ class ReportEncryptedSpamQuery : public Td::ResultHandler {
return on_error(id, result_ptr.move_as_error());
}
td->messages_manager_->on_get_peer_settings(dialog_id_,
make_tl_object<telegram_api::peerSettings>(0, false /*ignored*/));
td->messages_manager_->on_get_peer_settings(
dialog_id_,
make_tl_object<telegram_api::peerSettings>(0, false /*ignored*/, false /*ignored*/, false /*ignored*/,
false /*ignored*/, false /*ignored*/, false /*ignored*/));
promise_.set_value(Unit());
}

View File

@ -1697,11 +1697,6 @@ void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateUserBlocked> up
td_->contacts_manager_->on_update_user_blocked(UserId(update->user_id_), update->blocked_);
}
void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateContactLink> update, bool /*force_apply*/) {
td_->contacts_manager_->on_update_user_links(UserId(update->user_id_), std::move(update->my_link_),
std::move(update->foreign_link_));
}
void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateChatParticipants> update, bool /*force_apply*/) {
td_->contacts_manager_->on_get_chat_participants(std::move(update->participants_), true);
}
@ -1906,4 +1901,10 @@ void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateMessagePoll> up
// unsupported updates
void UpdatesManager::on_update(tl_object_ptr<telegram_api::updatePeerLocated> update, bool /*force_apply*/) {
}
void UpdatesManager::on_update(tl_object_ptr<telegram_api::updatePeerSettings> update, bool /*force_apply*/) {
}
} // namespace td

View File

@ -204,7 +204,6 @@ class UpdatesManager : public Actor {
void on_update(tl_object_ptr<telegram_api::updateUserPhone> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateUserPhoto> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateUserBlocked> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateContactLink> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateChatParticipants> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateChatParticipantAdd> update, bool /*force_apply*/);
@ -280,6 +279,10 @@ class UpdatesManager : public Actor {
void on_update(tl_object_ptr<telegram_api::updateMessagePoll> update, bool /*force_apply*/);
// unsupported updates
void on_update(tl_object_ptr<telegram_api::updatePeerLocated> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updatePeerSettings> update, bool /*force_apply*/);
};
} // namespace td

View File

@ -8,7 +8,7 @@
namespace td {
constexpr int32 MTPROTO_LAYER = 101;
constexpr int32 MTPROTO_LAYER = 102;
enum class Version : int32 {
Initial,