From 3d07b45a21d30d5d304f7cd0a4b9498295f9413d Mon Sep 17 00:00:00 2001 From: levlam Date: Sat, 14 Mar 2020 01:56:47 +0300 Subject: [PATCH] Update layer to 111. GitOrigin-RevId: 47862200a12f3b5b9e5058192d5e9a9cdca862aa --- td/generate/scheme/td_api.tl | 15 +++++-- td/generate/scheme/td_api.tlo | Bin 167960 -> 168060 bytes td/generate/scheme/telegram_api.tl | 43 ++++++++++++++++--- td/generate/scheme/telegram_api.tlo | Bin 201040 -> 205868 bytes td/telegram/CallActor.cpp | 9 +++- td/telegram/CallActor.h | 1 + td/telegram/ContactsManager.cpp | 26 +++++++++--- td/telegram/ContactsManager.h | 4 +- td/telegram/StickersManager.cpp | 5 ++- td/telegram/UpdatesManager.cpp | 9 ++++ td/telegram/UpdatesManager.h | 4 ++ td/telegram/Version.h | 2 +- td/telegram/WebPagesManager.cpp | 62 ++++++++++++++++++++++++---- td/telegram/WebPagesManager.h | 2 + td/telegram/cli.cpp | 4 +- 15 files changed, 154 insertions(+), 32 deletions(-) diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 57bfcaef..ab4d73d9 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -987,11 +987,13 @@ pageBlockRelatedArticles header:RichText articles:vector version:int32 is_rtl:Bool is_full:Bool = WebPageInstantView; +webPageInstantView page_blocks:vector view_count:int32 version:int32 is_rtl:Bool is_full:Bool = WebPageInstantView; //@description Describes a web page preview @@ -1738,8 +1740,13 @@ callDiscardReasonDisconnected = CallDiscardReason; callDiscardReasonHungUp = CallDiscardReason; -//@description Specifies the supported call protocols @udp_p2p True, if UDP peer-to-peer connections are supported @udp_reflector True, if connection through UDP reflectors is supported @min_layer The minimum supported API layer; use 65 @max_layer The maximum supported API layer; use 65 -callProtocol udp_p2p:Bool udp_reflector:Bool min_layer:int32 max_layer:int32 = CallProtocol; +//@description Specifies the supported call protocols +//@udp_p2p True, if UDP peer-to-peer connections are supported +//@udp_reflector True, if connection through UDP reflectors is supported +//@min_layer The minimum supported API layer; use 65 +//@max_layer The maximum supported API layer; use 65 +//@library_versions List of supported libtgvoip versions +callProtocol udp_p2p:Bool udp_reflector:Bool min_layer:int32 max_layer:int32 library_versions:vector = CallProtocol; //@description Describes the address of UDP reflectors @id Reflector identifier @ip IPv4 reflector address @ipv6 IPv6 reflector address @port Reflector port number @peer_tag Connection peer tag callConnection id:int64 ip:string ipv6:string port:int32 peer_tag:bytes = CallConnection; diff --git a/td/generate/scheme/td_api.tlo b/td/generate/scheme/td_api.tlo index 5973321d65c30a87cf557390ad419cdd5ea42c60..5f9d6e1c5815a9cb914bd2c09a44718c110b65b4 100644 GIT binary patch delta 233 zcmbQSfa}i!t_?d_Sn|!D?BBeH<%k-K>&#vDn_IMbq-8;3JjsbUIRQoaCHcwuISdR8 zAhDargnU>huXUR|IiQA(FEgnqv8Xb>EVZaOGe2)~z;hFbVLt90j9^xCgva&>55^CZ z6hTG{m8T{JB&Mf&<`tJD=9PqHrj|2+#KDG6H?KAE$=7@uh-_G%cvB!fGW(L#rKx;G{8Eyzp-J`2?hW* CB3#V? delta 193 zcmeyffNRDAt_?d_ShlXZesJ?1mLqB`0ZM6yHn(W=NXvr6c#;!yasrC-OY)QRa~K#H zKw>wK3Hh*0Uh6h_@&|1Wh|V5&4n{Dmd4|XK86J!uCMkl<5h_nj3P?;(^~@_SNz5w= z%SX-sIdLd9mX7SFn@c_7sehBh@w9> OOaWll_5fQZonQb7%u;{= diff --git a/td/generate/scheme/telegram_api.tl b/td/generate/scheme/telegram_api.tl index 6c123e30..5318ee34 100644 --- a/td/generate/scheme/telegram_api.tl +++ b/td/generate/scheme/telegram_api.tl @@ -59,6 +59,7 @@ inputMediaGame#d33f43f3 id:InputGame = InputMedia; inputMediaInvoice#f4e096c3 flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:string provider_data:DataJSON start_param:string = InputMedia; inputMediaGeoLive#ce4e82fd flags:# stopped:flags.0?true geo_point:InputGeoPoint period:flags.1?int = InputMedia; inputMediaPoll#abe9ca25 flags:# poll:Poll correct_answers:flags.0?Vector = InputMedia; +inputMediaDice#aeffa807 = InputMedia; inputChatPhotoEmpty#1ca48f57 = InputChatPhoto; inputChatUploadedPhoto#927c55b4 file:InputFile = InputChatPhoto; @@ -115,7 +116,7 @@ channel#d31a961e flags:# creator:flags.0?true left:flags.2?true broadcast:flags. 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 has_scheduled:flags.8?true id:int about:string participants:ChatParticipants chat_photo:flags.2?Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite bot_info:flags.3?Vector pinned_msg_id:flags.6?int folder_id:flags.11?int = ChatFull; -channelFull#2d895c74 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 has_scheduled:flags.19?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 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 slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int pts:int = ChatFull; +channelFull#f0e6672a 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 has_scheduled:flags.19?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 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 slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int = ChatFull; chatParticipant#c8d7493e user_id:int inviter_id:int date:int = ChatParticipant; chatParticipantCreator#da13538a user_id:int = ChatParticipant; @@ -143,6 +144,7 @@ messageMediaGame#fdb19008 game:Game = MessageMedia; messageMediaInvoice#84551347 flags:# shipping_address_requested:flags.1?true test:flags.3?true title:string description:string photo:flags.0?WebDocument receipt_msg_id:flags.2?int currency:string total_amount:long start_param:string = MessageMedia; messageMediaGeoLive#7c3c2609 geo:GeoPoint period:int = MessageMedia; messageMediaPoll#4bd6e798 poll:Poll results:PollResults = MessageMedia; +messageMediaDice#638fe46b value:int = MessageMedia; messageActionEmpty#b6aef7b0 = MessageAction; messageActionChatCreate#a6638b9a title:string users:Vector = MessageAction; @@ -339,6 +341,9 @@ updateTheme#8216fba3 theme:Theme = Update; updateGeoLiveViewed#871fb939 peer:Peer msg_id:int = Update; updateLoginToken#564fe691 = Update; updateMessagePollVote#42f88f2c poll_id:long user_id:int options:Vector = Update; +updateDialogFilter#26ffde7d flags:# id:int filter:flags.0?DialogFilter = Update; +updateDialogFilterOrder#a5d72105 order:Vector = Update; +updateDialogFilters#3504914f = Update; updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State; @@ -489,7 +494,7 @@ messages.affectedMessages#84d19185 pts:int pts_count:int = messages.AffectedMess webPageEmpty#eb1477e8 id:long = WebPage; webPagePending#c586da1c id:long date:int = WebPage; webPage#e89c45b2 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 attributes:flags.12?Vector = WebPage; -webPageNotModified#85849473 = WebPage; +webPageNotModified#7311ca11 flags:# cached_page_views:flags.0?int = WebPage; authorization#ad01d61d flags:# current:flags.0?true official_app:flags.1?true password_pending:flags.2?true hash:long device_model:string platform:string system_version:string api_id:int app_name:string app_version:string date_created:int date_active:int ip:string country:string region:string = Authorization; @@ -515,6 +520,7 @@ inputStickerSetEmpty#ffb62b95 = InputStickerSet; inputStickerSetID#9de7a269 id:long access_hash:long = InputStickerSet; inputStickerSetShortName#861cc8a0 short_name:string = InputStickerSet; inputStickerSetAnimatedEmoji#28703c8 = InputStickerSet; +inputStickerSetDice#79e21a53 = InputStickerSet; stickerSet#eeb46f27 flags:# archived:flags.1?true official:flags.2?true masks:flags.3?true animated:flags.5?true installed_date:flags.0?int id:long access_hash:long title:string short_name:string thumb:flags.4?PhotoSize thumb_dc_id:flags.4?int count:int hash:int = StickerSet; @@ -810,7 +816,7 @@ phoneCallDiscarded#50ca4de1 flags:# need_rating:flags.2?true need_debug:flags.3? phoneConnection#9d4c17c0 id:long ip:string ipv6:string port:int peer_tag:bytes = PhoneConnection; -phoneCallProtocol#a2bb35cb flags:# udp_p2p:flags.0?true udp_reflector:flags.1?true min_layer:int max_layer:int = PhoneCallProtocol; +phoneCallProtocol#fc878fc8 flags:# udp_p2p:flags.0?true udp_reflector:flags.1?true min_layer:int max_layer:int library_versions:Vector = PhoneCallProtocol; phone.phoneCall#ec82e140 phone_call:PhoneCall users:Vector = phone.PhoneCall; @@ -996,7 +1002,7 @@ pageListOrderedItemBlocks#98dd8936 num:string blocks:Vector = PageLis pageRelatedArticle#b390dc08 flags:# url:string webpage_id:long title:flags.0?string description:flags.1?string photo_id:flags.2?long author:flags.3?string published_date:flags.4?int = PageRelatedArticle; -page#ae891bec flags:# part:flags.0?true rtl:flags.1?true v2:flags.2?true url:string blocks:Vector photos:Vector documents:Vector = Page; +page#98657f0d flags:# part:flags.0?true rtl:flags.1?true v2:flags.2?true url:string blocks:Vector photos:Vector documents:Vector views:flags.3?int = Page; help.supportName#8c05f1c9 name:string = help.SupportName; @@ -1103,6 +1109,24 @@ bankCardOpenUrl#f568028a url:string name:string = BankCardOpenUrl; payments.bankCardData#3e24e573 title:string open_urls:Vector = payments.BankCardData; +dialogFilter#7438f7e8 flags:# contacts:flags.0?true non_contacts:flags.1?true groups:flags.2?true broadcasts:flags.3?true bots:flags.4?true exclude_muted:flags.11?true exclude_read:flags.12?true exclude_archived:flags.13?true id:int title:string emoticon:flags.25?string pinned_peers:Vector include_peers:Vector exclude_peers:Vector = DialogFilter; + +dialogFilterSuggested#77744d4a filter:DialogFilter description:string = DialogFilterSuggested; + +statsDateRangeDays#b637edaf min_date:int max_date:int = StatsDateRangeDays; + +statsAbsValueAndPrev#cb43acde current:double previous:double = StatsAbsValueAndPrev; + +statsPercentValue#cbce2fe0 part:double total:double = StatsPercentValue; + +statsGraphAsync#4a27eb2d token:string = StatsGraph; +statsGraphError#bedc9822 error:string = StatsGraph; +statsGraph#8ea464b6 flags:# json:DataJSON zoom_token:flags.0?string = StatsGraph; + +messageInteractionCounters#ad4fc9bd msg_id:int views:int forwards:int = MessageInteractionCounters; + +stats.broadcastStats#bdf78394 period:StatsDateRangeDays followers:StatsAbsValueAndPrev views_per_post:StatsAbsValueAndPrev shares_per_post:StatsAbsValueAndPrev enabled_notifications:StatsPercentValue growth_graph:StatsGraph followers_graph:StatsGraph mute_graph:StatsGraph top_hours_graph:StatsGraph interactions_graph:StatsGraph iv_interactions_graph:StatsGraph views_by_source_graph:StatsGraph new_followers_by_source_graph:StatsGraph languages_graph:StatsGraph recent_message_interactions:Vector = stats.BroadcastStats; + ---functions--- invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X; @@ -1341,6 +1365,10 @@ messages.sendScheduledMessages#bd38850a peer:InputPeer id:Vector = Updates; messages.deleteScheduledMessages#59ae2b16 peer:InputPeer id:Vector = Updates; messages.getPollVotes#b86e380e flags:# peer:InputPeer id:int option:flags.0?bytes offset:flags.1?string limit:int = messages.VotesList; messages.toggleStickerSets#b5052fea flags:# uninstall:flags.0?true archive:flags.1?true unarchive:flags.2?true stickersets:Vector = Bool; +messages.getDialogFilters#f19ed96d = Vector; +messages.getSuggestedDialogFilters#a29cd42c = Vector; +messages.updateDialogFilter#1ad4a04a flags:# id:int filter:flags.0?DialogFilter = Bool; +messages.updateDialogFiltersOrder#c563c1e4 order:Vector = Bool; updates.getState#edd4882a = updates.State; updates.getDifference#25939651 flags:# pts:int pts_total_limit:flags.0?int date:int qts:int = updates.Difference; @@ -1418,6 +1446,7 @@ channels.getInactiveChannels#11e831ee = messages.InactiveChats; bots.sendCustomRequest#aa2769ed custom_method:string params:DataJSON = DataJSON; bots.answerWebhookJSONQuery#e6213f4d query_id:long data:DataJSON = Bool; +bots.setBotCommands#805d46f6 commands:Vector = Bool; payments.getPaymentForm#99f09745 msg_id:int = payments.PaymentForm; payments.getPaymentReceipt#a092a980 msg_id:int = payments.PaymentReceipt; @@ -1427,10 +1456,11 @@ payments.getSavedInfo#227d824b = payments.SavedInfo; payments.clearSavedInfo#d83d70c1 flags:# credentials:flags.0?true info:flags.1?true = Bool; payments.getBankCardData#2e79d779 number:string = payments.BankCardData; -stickers.createStickerSet#9bd86e6a flags:# masks:flags.0?true user_id:InputUser title:string short_name:string stickers:Vector = messages.StickerSet; +stickers.createStickerSet#f1036780 flags:# masks:flags.0?true animated:flags.1?true user_id:InputUser title:string short_name:string thumb:flags.2?InputDocument stickers:Vector = messages.StickerSet; stickers.removeStickerFromSet#f7760f51 sticker:InputDocument = messages.StickerSet; stickers.changeStickerPosition#ffb6d4ca sticker:InputDocument position:int = messages.StickerSet; stickers.addStickerToSet#8653febe stickerset:InputStickerSet sticker:InputStickerSetItem = messages.StickerSet; +stickers.setStickerSetThumb#9a364e30 stickerset:InputStickerSet thumb:InputDocument = messages.StickerSet; phone.getCallConfig#55451fa9 = DataJSON; phone.requestCall#42ff96ed flags:# video:flags.0?true user_id:InputUser random_id:int g_a_hash:bytes protocol:PhoneCallProtocol = phone.PhoneCall; @@ -1449,3 +1479,6 @@ langpack.getLanguage#6a596502 lang_pack:string lang_code:string = LangPackLangua folders.editPeerFolders#6847d0ab folder_peers:Vector = Updates; folders.deleteFolder#1c295881 folder_id:int = Updates; + +stats.getBroadcastStats#ab42441a flags:# dark:flags.0?true channel:InputChannel = stats.BroadcastStats; +stats.loadAsyncGraph#621d5fa0 flags:# token:string x:flags.0?long = StatsGraph; diff --git a/td/generate/scheme/telegram_api.tlo b/td/generate/scheme/telegram_api.tlo index f6a5af62859502c81cc440d466e8606edb68147b..89a597f639baa257568ff065df789849dd4fe696 100644 GIT binary patch delta 6569 zcmaJGe{@qVGk`@gDDeii%ky}JCLeYW)=& zVd0feszl?GfF~Gkc_a`Ng=p8=X(h{6i0wscU|m~Fix3k9U)Q#hRR1J@PGR%ak_Yl0 z3q{(*6@o9|(U_#CwZ*CGd+f02WJAUF0*a~=1Ky{EXq_PHDZ0Z{r7J!3_NqN4D}-3g z(;_?;!WunZF%S;bhTF(TtZVzdMVj1yKWS7*n0SpQpGc6#%;$3RHwisDH|EBsrmhs- zfVxx9|M+I=l4ZUA-aqx%zH6=%Jz}h;Irg|G*e2A3eD0{Q4$~Iz`*_iTDHOTHBMRU2 zgj$3po()7};lbj@@8wa{qft-9uh9~1MWgq>_iiDDx`n7$2#G|Zw4iiaYVC|GAph9l zfr?4riukZFjXSm4_Ggg4ro8m^oHar-F;6FTl~_{WDn|vDEzf*%$Q&bP&3`Bw_V~P> zm`LPyrLC!}3tRxyr0)B2dx?&?PU>4>r;Aj2h0dxYaYJKH=#=_{xv9b@KLB$HhzIvK zGxFAcvE}mEWUt>73JF0HU4sApi7Cs=rE3f4rCh-QeUX7GZ}fRFA5?gaQdf@!%GA?pU~LaCJJcv2Vg3?u>=$vIXEhKeA3VA zW==J6h$rgx2i6HbjRt-2Hdri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CdfypioAwvucE*0hY%Oono z3-YeD1wsK<6bNDQ sx79a4K$BUp;qpns0?auLbFpEMVs>D^a=Q$78PW5M&?*O~3!$9<0lsO@3IG5A diff --git a/td/telegram/CallActor.cpp b/td/telegram/CallActor.cpp index 892cae8a..1d82b449 100644 --- a/td/telegram/CallActor.cpp +++ b/td/telegram/CallActor.cpp @@ -41,6 +41,7 @@ CallProtocol CallProtocol::from_telegram_api(const telegram_api::phoneCallProtoc res.udp_reflector = protocol.udp_reflector_; res.min_layer = protocol.min_layer_; res.max_layer = protocol.max_layer_; + res.library_versions = protocol.library_versions_; return res; } @@ -52,7 +53,8 @@ tl_object_ptr CallProtocol::as_telegram_api() c if (udp_reflector) { flags |= telegram_api::phoneCallProtocol::UDP_REFLECTOR_MASK; } - return make_tl_object(flags, udp_p2p, udp_reflector, min_layer, max_layer); + return make_tl_object(flags, udp_p2p, udp_reflector, min_layer, max_layer, + vector(library_versions)); } CallProtocol CallProtocol::from_td_api(const td_api::callProtocol &protocol) { @@ -61,10 +63,13 @@ CallProtocol CallProtocol::from_td_api(const td_api::callProtocol &protocol) { res.udp_reflector = protocol.udp_reflector_; res.min_layer = protocol.min_layer_; res.max_layer = protocol.max_layer_; + res.library_versions = protocol.library_versions_; return res; } + tl_object_ptr CallProtocol::as_td_api() const { - return make_tl_object(udp_p2p, udp_reflector, min_layer, max_layer); + return make_tl_object(udp_p2p, udp_reflector, min_layer, max_layer, + vector(library_versions)); } CallConnection CallConnection::from_telegram_api(const telegram_api::phoneConnection &connection) { diff --git a/td/telegram/CallActor.h b/td/telegram/CallActor.h index c13e9c2c..6adc9b98 100644 --- a/td/telegram/CallActor.h +++ b/td/telegram/CallActor.h @@ -32,6 +32,7 @@ struct CallProtocol { bool udp_reflector{true}; int32 min_layer{65}; int32 max_layer{65}; + vector library_versions; static CallProtocol from_telegram_api(const telegram_api::phoneCallProtocol &protocol); tl_object_ptr as_telegram_api() const; diff --git a/td/telegram/ContactsManager.cpp b/td/telegram/ContactsManager.cpp index 24a978a2..a2ab6bcd 100644 --- a/td/telegram/ContactsManager.cpp +++ b/td/telegram/ContactsManager.cpp @@ -3383,6 +3383,7 @@ void ContactsManager::ChannelFull::store(StorerT &storer) const { bool has_bot_user_ids = !bot_user_ids.empty(); bool is_slow_mode_enabled = slow_mode_delay != 0; bool is_slow_mode_delay_active = slow_mode_next_send_date != 0; + bool has_stats_dc_id = stats_dc_id.is_exact(); BEGIN_STORE_FLAGS(); STORE_FLAG(has_description); STORE_FLAG(has_administrator_count); @@ -3396,13 +3397,14 @@ void ContactsManager::ChannelFull::store(StorerT &storer) const { STORE_FLAG(can_get_participants); STORE_FLAG(can_set_username); STORE_FLAG(can_set_sticker_set); - STORE_FLAG(can_view_statistics); + STORE_FLAG(false); // legacy_can_view_statistics STORE_FLAG(is_all_history_available); STORE_FLAG(can_set_location); STORE_FLAG(has_location); STORE_FLAG(has_bot_user_ids); STORE_FLAG(is_slow_mode_enabled); STORE_FLAG(is_slow_mode_delay_active); + STORE_FLAG(has_stats_dc_id); END_STORE_FLAGS(); if (has_description) { store(description, storer); @@ -3445,6 +3447,9 @@ void ContactsManager::ChannelFull::store(StorerT &storer) const { store(slow_mode_next_send_date, storer); } store_time(expires_at, storer); + if (has_stats_dc_id) { + store(stats_dc_id.get_raw_id(), storer); + } } template @@ -3459,10 +3464,12 @@ void ContactsManager::ChannelFull::parse(ParserT &parser) { bool has_linked_channel_id; bool has_migrated_from_max_message_id; bool has_migrated_from_chat_id; + bool legacy_can_view_statistics; bool has_location; bool has_bot_user_ids; bool is_slow_mode_enabled; bool is_slow_mode_delay_active; + bool has_stats_dc_id; BEGIN_PARSE_FLAGS(); PARSE_FLAG(has_description); PARSE_FLAG(has_administrator_count); @@ -3476,13 +3483,14 @@ void ContactsManager::ChannelFull::parse(ParserT &parser) { PARSE_FLAG(can_get_participants); PARSE_FLAG(can_set_username); PARSE_FLAG(can_set_sticker_set); - PARSE_FLAG(can_view_statistics); + PARSE_FLAG(legacy_can_view_statistics); PARSE_FLAG(is_all_history_available); PARSE_FLAG(can_set_location); PARSE_FLAG(has_location); PARSE_FLAG(has_bot_user_ids); PARSE_FLAG(is_slow_mode_enabled); PARSE_FLAG(is_slow_mode_delay_active); + PARSE_FLAG(has_stats_dc_id); END_PARSE_FLAGS(); if (has_description) { parse(description, parser); @@ -3525,6 +3533,9 @@ void ContactsManager::ChannelFull::parse(ParserT &parser) { parse(slow_mode_next_send_date, parser); } parse_time(expires_at, parser); + if (has_stats_dc_id) { + stats_dc_id = DcId::create(parser.fetch_int()); + } } template @@ -8720,13 +8731,16 @@ void ContactsManager::on_get_chat_full(tl_object_ptr &&c auto can_set_username = (channel_full->flags_ & CHANNEL_FULL_FLAG_CAN_SET_USERNAME) != 0; auto can_set_sticker_set = (channel_full->flags_ & CHANNEL_FULL_FLAG_CAN_SET_STICKER_SET) != 0; auto can_set_location = (channel_full->flags_ & CHANNEL_FULL_FLAG_CAN_SET_LOCATION) != 0; - auto can_view_statistics = (channel_full->flags_ & CHANNEL_FULL_FLAG_CAN_VIEW_STATISTICS) != 0; auto is_all_history_available = (channel_full->flags_ & CHANNEL_FULL_FLAG_IS_ALL_HISTORY_HIDDEN) == 0; StickerSetId sticker_set_id; if (channel_full->stickerset_ != nullptr) { sticker_set_id = td_->stickers_manager_->on_get_sticker_set(std::move(channel_full->stickerset_), true, "on_get_channel_full"); } + DcId stats_dc_id; + if ((channel_full->flags_ & CHANNEL_FULL_FLAG_CAN_VIEW_STATISTICS) != 0) { + stats_dc_id = DcId::create(channel_full->stats_dc_); + } ChannelFull *channel = add_channel_full(channel_id); channel->repair_request_version = 0; @@ -8735,7 +8749,7 @@ void ContactsManager::on_get_chat_full(tl_object_ptr &&c channel->administrator_count != administrator_count || channel->restricted_count != restricted_count || channel->banned_count != banned_count || channel->can_get_participants != can_get_participants || channel->can_set_username != can_set_username || channel->can_set_sticker_set != can_set_sticker_set || - channel->can_set_location != can_set_location || channel->can_view_statistics != can_view_statistics || + channel->can_set_location != can_set_location || channel->stats_dc_id != stats_dc_id || channel->sticker_set_id != sticker_set_id || channel->is_all_history_available != is_all_history_available) { channel->description = std::move(channel_full->about_); channel->participant_count = participant_count; @@ -8746,7 +8760,7 @@ void ContactsManager::on_get_chat_full(tl_object_ptr &&c channel->can_set_username = can_set_username; channel->can_set_sticker_set = can_set_sticker_set; channel->can_set_location = can_set_location; - channel->can_view_statistics = can_view_statistics; + channel->stats_dc_id = stats_dc_id; channel->is_all_history_available = is_all_history_available; channel->sticker_set_id = sticker_set_id; @@ -12976,7 +12990,7 @@ tl_object_ptr ContactsManager::get_supergroup_full_i channel_full->restricted_count, channel_full->banned_count, DialogId(channel_full->linked_channel_id).get(), channel_full->slow_mode_delay, slow_mode_delay_expires_in, channel_full->can_get_participants, channel_full->can_set_username, channel_full->can_set_sticker_set, channel_full->can_set_location, - channel_full->can_view_statistics, channel_full->is_all_history_available, channel_full->sticker_set_id.get(), + channel_full->stats_dc_id.is_exact(), channel_full->is_all_history_available, channel_full->sticker_set_id.get(), channel_full->location.get_chat_location_object(), channel_full->invite_link, get_basic_group_id_object(channel_full->migrated_from_chat_id, "get_supergroup_full_info_object"), channel_full->migrated_from_max_message_id.get()); diff --git a/td/telegram/ContactsManager.h b/td/telegram/ContactsManager.h index 9eeacd66..7345c760 100644 --- a/td/telegram/ContactsManager.h +++ b/td/telegram/ContactsManager.h @@ -21,6 +21,7 @@ #include "td/telegram/files/FileSourceId.h" #include "td/telegram/Location.h" #include "td/telegram/MessageId.h" +#include "td/telegram/net/DcId.h" #include "td/telegram/Photo.h" #include "td/telegram/PublicDialogType.h" #include "td/telegram/QueryCombiner.h" @@ -771,6 +772,8 @@ class ContactsManager : public Actor { DialogLocation location; + DcId stats_dc_id; + int32 slow_mode_delay = 0; int32 slow_mode_next_send_date = 0; @@ -783,7 +786,6 @@ class ContactsManager : public Actor { bool can_set_username = false; bool can_set_sticker_set = false; bool can_set_location = false; - bool can_view_statistics = false; bool is_all_history_available = true; bool is_slow_mode_next_send_date_changed = true; diff --git a/td/telegram/StickersManager.cpp b/td/telegram/StickersManager.cpp index 0c5a54cf..d79d0d21 100644 --- a/td/telegram/StickersManager.cpp +++ b/td/telegram/StickersManager.cpp @@ -874,8 +874,9 @@ class CreateNewStickerSetQuery : public Td::ResultHandler { flags |= telegram_api::stickers_createStickerSet::MASKS_MASK; } - send_query(G()->net_query_creator().create(telegram_api::stickers_createStickerSet( - flags, false /*ignored*/, std::move(input_user), title, short_name, std::move(input_stickers)))); + send_query(G()->net_query_creator().create( + telegram_api::stickers_createStickerSet(flags, false /*ignored*/, false /*ignored*/, std::move(input_user), + title, short_name, nullptr, std::move(input_stickers)))); } void on_result(uint64 id, BufferSlice packet) override { diff --git a/td/telegram/UpdatesManager.cpp b/td/telegram/UpdatesManager.cpp index 80e6e13d..f4017b95 100644 --- a/td/telegram/UpdatesManager.cpp +++ b/td/telegram/UpdatesManager.cpp @@ -2017,4 +2017,13 @@ void UpdatesManager::on_update(tl_object_ptr upd void UpdatesManager::on_update(tl_object_ptr update, bool /*force_apply*/) { } +void UpdatesManager::on_update(tl_object_ptr update, bool /*force_apply*/) { +} + +void UpdatesManager::on_update(tl_object_ptr update, bool /*force_apply*/) { +} + +void UpdatesManager::on_update(tl_object_ptr update, bool /*force_apply*/) { +} + } // namespace td diff --git a/td/telegram/UpdatesManager.h b/td/telegram/UpdatesManager.h index e2c95c8b..28036f15 100644 --- a/td/telegram/UpdatesManager.h +++ b/td/telegram/UpdatesManager.h @@ -291,6 +291,10 @@ class UpdatesManager : public Actor { // unsupported updates void on_update(tl_object_ptr update, bool /*force_apply*/); + + void on_update(tl_object_ptr update, bool /*force_apply*/); + void on_update(tl_object_ptr update, bool /*force_apply*/); + void on_update(tl_object_ptr update, bool /*force_apply*/); }; } // namespace td diff --git a/td/telegram/Version.h b/td/telegram/Version.h index 515112c1..113a6231 100644 --- a/td/telegram/Version.h +++ b/td/telegram/Version.h @@ -8,7 +8,7 @@ namespace td { -constexpr int32 MTPROTO_LAYER = 110; +constexpr int32 MTPROTO_LAYER = 111; enum class Version : int32 { Initial, diff --git a/td/telegram/WebPagesManager.cpp b/td/telegram/WebPagesManager.cpp index 538cb837..55d5ecd9 100644 --- a/td/telegram/WebPagesManager.cpp +++ b/td/telegram/WebPagesManager.cpp @@ -92,13 +92,15 @@ class GetWebPagePreviewQuery : public Td::ResultHandler { class GetWebPageQuery : public Td::ResultHandler { Promise promise_; + WebPageId web_page_id_; string url_; public: explicit GetWebPageQuery(Promise &&promise) : promise_(std::move(promise)) { } - void send(const string &url, int32 hash) { + void send(WebPageId web_page_id, const string &url, int32 hash) { + web_page_id_ = web_page_id; url_ = url; send_query(G()->net_query_creator().create(telegram_api::messages_getWebPage(url, hash))); } @@ -111,7 +113,17 @@ class GetWebPageQuery : public Td::ResultHandler { auto ptr = result_ptr.move_as_ok(); LOG(INFO) << "Receive result for GetWebPageQuery " << to_string(ptr); - if (ptr->get_id() != telegram_api::webPageNotModified::ID) { + if (ptr->get_id() == telegram_api::webPageNotModified::ID) { + if (web_page_id_.is_valid()) { + auto web_page = move_tl_object_as(ptr); + int32 view_count = (web_page->flags_ & telegram_api::webPageNotModified::CACHED_PAGE_VIEWS_MASK) != 0 + ? web_page->cached_page_views_ + : 0; + td->web_pages_manager_->on_get_web_page_instant_view_view_count(web_page_id_, view_count); + } else { + LOG(ERROR) << "Receive webPageNotModified for " << url_; + } + } else { auto web_page_id = td->web_pages_manager_->on_get_web_page(std::move(ptr), DialogId()); td->web_pages_manager_->on_get_web_page_by_url(url_, web_page_id, false); } @@ -128,6 +140,7 @@ class WebPagesManager::WebPageInstantView { public: vector> page_blocks; string url; + int32 view_count = 0; int32 hash = 0; bool is_v2 = false; bool is_rtl = false; @@ -140,12 +153,14 @@ class WebPagesManager::WebPageInstantView { void store(StorerT &storer) const { using ::td::store; bool has_url = !url.empty(); + bool has_view_count = view_count > 0; BEGIN_STORE_FLAGS(); STORE_FLAG(is_full); STORE_FLAG(is_loaded); STORE_FLAG(is_rtl); STORE_FLAG(is_v2); STORE_FLAG(has_url); + STORE_FLAG(has_view_count); END_STORE_FLAGS(); store(page_blocks, storer); @@ -153,6 +168,9 @@ class WebPagesManager::WebPageInstantView { if (has_url) { store(url, storer); } + if (has_view_count) { + store(view_count, storer); + } CHECK(!is_empty); } @@ -160,12 +178,14 @@ class WebPagesManager::WebPageInstantView { void parse(ParserT &parser) { using ::td::parse; bool has_url; + bool has_view_count; BEGIN_PARSE_FLAGS(); PARSE_FLAG(is_full); PARSE_FLAG(is_loaded); PARSE_FLAG(is_rtl); PARSE_FLAG(is_v2); PARSE_FLAG(has_url); + PARSE_FLAG(has_view_count); END_PARSE_FLAGS(); parse(page_blocks, parser); @@ -173,15 +193,19 @@ class WebPagesManager::WebPageInstantView { if (has_url) { parse(url, parser); } + if (has_view_count) { + parse(view_count, parser); + } is_empty = false; } friend StringBuilder &operator<<(StringBuilder &string_builder, const WebPagesManager::WebPageInstantView &instant_view) { return string_builder << "InstantView(url = " << instant_view.url << ", size = " << instant_view.page_blocks.size() - << ", hash = " << instant_view.hash << ", is_empty = " << instant_view.is_empty - << ", is_v2 = " << instant_view.is_v2 << ", is_rtl = " << instant_view.is_rtl - << ", is_full = " << instant_view.is_full << ", is_loaded = " << instant_view.is_loaded + << ", view_count = " << instant_view.view_count << ", hash = " << instant_view.hash + << ", is_empty = " << instant_view.is_empty << ", is_v2 = " << instant_view.is_v2 + << ", is_rtl = " << instant_view.is_rtl << ", is_full = " << instant_view.is_full + << ", is_loaded = " << instant_view.is_loaded << ", was_loaded_from_database = " << instant_view.was_loaded_from_database << ")"; } }; @@ -633,11 +657,29 @@ bool WebPagesManager::need_use_old_instant_view(const WebPageInstantView &new_in return new_instant_view.was_loaded_from_database; } +void WebPagesManager::on_get_web_page_instant_view_view_count(WebPageId web_page_id, int32 view_count) { + if (get_web_page_instant_view(web_page_id) == nullptr) { + return; + } + + auto *instant_view = &web_pages_[web_page_id]->instant_view; + CHECK(!instant_view->is_empty); + if (instant_view->view_count >= view_count) { + return; + } + instant_view->view_count = view_count; + if (G()->parameters().use_message_db) { + LOG(INFO) << "Save instant view of " << web_page_id << " to database after updating view count to " << view_count; + G()->td_db()->get_sqlite_pmc()->set(get_web_page_instant_view_database_key(web_page_id), + log_event_store(*instant_view).as_slice().str(), Auto()); + } +} + void WebPagesManager::on_get_web_page_by_url(const string &url, WebPageId web_page_id, bool from_database) { auto &cached_web_page_id = url_to_web_page_id_[url]; if (!from_database && G()->parameters().use_message_db) { if (web_page_id.is_valid()) { - if (cached_web_page_id != web_page_id) { //not already saved + if (cached_web_page_id != web_page_id) { // not already saved G()->td_db()->get_sqlite_pmc()->set(get_web_page_url_database_key(url), to_string(web_page_id.get()), Auto()); } } else { @@ -873,7 +915,7 @@ void WebPagesManager::reload_web_page_instant_view(WebPageId web_page_id) { } td_->create_handler(std::move(promise)) - ->send(web_page->url, web_page->instant_view.is_full ? web_page->instant_view.hash : 0); + ->send(web_page_id, web_page->url, web_page->instant_view.is_full ? web_page->instant_view.hash : 0); } void WebPagesManager::on_load_web_page_instant_view_from_database(WebPageId web_page_id, string value) { @@ -1092,7 +1134,7 @@ void WebPagesManager::reload_web_page_by_url(const string &url, Promise && } LOG(INFO) << "Reload url \"" << url << '"'; - td_->create_handler(std::move(promise))->send(url, 0); + td_->create_handler(std::move(promise))->send(WebPageId(), url, 0); } SecretInputMedia WebPagesManager::get_secret_input_media(WebPageId web_page_id) const { @@ -1248,7 +1290,8 @@ tl_object_ptr WebPagesManager::get_web_page_instant_ } return td_api::make_object( get_page_block_objects(web_page_instant_view->page_blocks, td_, web_page_instant_view->url), - web_page_instant_view->is_v2 ? 2 : 1, web_page_instant_view->is_rtl, web_page_instant_view->is_full); + web_page_instant_view->view_count, web_page_instant_view->is_v2 ? 2 : 1, web_page_instant_view->is_rtl, + web_page_instant_view->is_full); } void WebPagesManager::on_web_page_changed(WebPageId web_page_id, bool have_web_page) { @@ -1412,6 +1455,7 @@ void WebPagesManager::on_get_web_page_instant_view(WebPage *web_page, tl_object_ << " photos, " << videos.size() << " videos and " << voice_notes.size() << " voice notes"; web_page->instant_view.page_blocks = get_web_page_blocks(td_, std::move(page->blocks_), animations, audios, documents, photos, videos, voice_notes); + web_page->instant_view.view_count = (page->flags_ & telegram_api::page::VIEWS_MASK) != 0 ? page->views_ : 0; web_page->instant_view.is_v2 = (page->flags_ & telegram_api::page::V2_MASK) != 0; web_page->instant_view.is_rtl = (page->flags_ & telegram_api::page::RTL_MASK) != 0; web_page->instant_view.hash = hash; diff --git a/td/telegram/WebPagesManager.h b/td/telegram/WebPagesManager.h index 3f6a76c4..8b80a7b9 100644 --- a/td/telegram/WebPagesManager.h +++ b/td/telegram/WebPagesManager.h @@ -47,6 +47,8 @@ class WebPagesManager : public Actor { void on_get_web_page_by_url(const string &url, WebPageId web_page_id, bool from_database); + void on_get_web_page_instant_view_view_count(WebPageId web_page_id, int32 view_count); + void register_web_page(WebPageId web_page_id, FullMessageId full_message_id, const char *source); void unregister_web_page(WebPageId web_page_id, FullMessageId full_message_id, const char *source); diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp index 8f9e3ec1..ce251832 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -2657,7 +2657,7 @@ class CliClient final : public Actor { send_request(td_api::make_object(as_secret_chat_id(args))); } else if (op == "cc" || op == "CreateCall") { send_request(td_api::make_object( - as_user_id(args), td_api::make_object(true, true, 65, 65))); + as_user_id(args), td_api::make_object(true, true, 65, 65, vector{"2.6"}))); } else if (op == "dc" || op == "DiscardCall") { string call_id; string is_disconnected; @@ -2666,7 +2666,7 @@ class CliClient final : public Actor { send_request(td_api::make_object(as_call_id(call_id), as_bool(is_disconnected), 0, 0)); } else if (op == "ac" || op == "AcceptCall") { send_request(td_api::make_object( - as_call_id(args), td_api::make_object(true, true, 65, 65))); + as_call_id(args), td_api::make_object(true, true, 65, 65, vector{"2.6"}))); } else if (op == "scr" || op == "SendCallRating") { string call_id; string rating;