From d1f1a14a37c8f11fb5ff82615678837f872eb752 Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 22 Feb 2018 03:36:40 +0300 Subject: [PATCH] Update layer to 76: add messageWebsiteConnected. GitOrigin-RevId: 8cb5128a7d7eac2afe0622fc901392bf318fa460 --- td/generate/scheme/mtproto_api.tl | 2 +- td/generate/scheme/mtproto_api.tlo | Bin 8268 -> 8276 bytes td/generate/scheme/secret_api.tl | 2 + td/generate/scheme/secret_api.tlo | Bin 13868 -> 14120 bytes td/generate/scheme/td_api.tl | 3 + td/generate/scheme/td_api.tlo | Bin 111120 -> 111220 bytes td/generate/scheme/telegram_api.tl | 33 +++++++---- td/generate/scheme/telegram_api.tlo | Bin 147708 -> 149268 bytes td/mtproto/Handshake.cpp | 4 +- td/mtproto/PingConnection.h | 2 +- td/telegram/ConfigManager.cpp | 19 ++----- td/telegram/ContactsManager.cpp | 22 ++++---- td/telegram/ContactsManager.h | 2 +- td/telegram/DialogId.cpp | 35 ++++++------ td/telegram/DialogId.h | 3 + td/telegram/MessageEntity.cpp | 26 ++++++--- td/telegram/MessagesManager.cpp | 84 ++++++++++++++++++++++++++-- td/telegram/MessagesManager.h | 20 +++++++ td/telegram/StickersManager.cpp | 2 +- td/telegram/UpdatesManager.cpp | 1 + td/telegram/net/MtprotoHeader.cpp | 2 +- 21 files changed, 190 insertions(+), 72 deletions(-) diff --git a/td/generate/scheme/mtproto_api.tl b/td/generate/scheme/mtproto_api.tl index b1470c10..b89e9bde 100644 --- a/td/generate/scheme/mtproto_api.tl +++ b/td/generate/scheme/mtproto_api.tl @@ -68,7 +68,7 @@ rsa_public_key n:string e:string = RSAPublicKey; ---functions--- -req_pq#60469778 nonce:int128 = ResPQ; +req_pq_multi#be7e8ef1 nonce:int128 = ResPQ; req_DH_params#d712e4be nonce:int128 server_nonce:int128 p:string q:string public_key_fingerprint:long encrypted_data:string = Server_DH_Params; diff --git a/td/generate/scheme/mtproto_api.tlo b/td/generate/scheme/mtproto_api.tlo index 692f5496ec31322074161e9729e602515768be99..6c3583ddb3882e4c45f225acba54d52fe0e365fe 100644 GIT binary patch delta 32 ocmX@(aK&N67dhdNeRcbIic$;X3ku_NOLIyx85lPIm-A%=0RG4g?EnA( delta 24 fcmccOaK>T77dh^V>23*ZMX81H1%;d0<$W0ehMEaj diff --git a/td/generate/scheme/secret_api.tl b/td/generate/scheme/secret_api.tl index 8794c142..32db7251 100644 --- a/td/generate/scheme/secret_api.tl +++ b/td/generate/scheme/secret_api.tl @@ -93,6 +93,8 @@ messageEntityCode#28a20571 offset:int length:int = MessageEntity; messageEntityPre#73924be0 offset:int length:int language:string = MessageEntity; messageEntityTextUrl#76a6d327 offset:int length:int url:string = MessageEntity; messageEntityMentionName#352dca58 offset:int length:int user_id:int = MessageEntity; +messageEntityPhone#9b69e34b offset:int length:int = MessageEntity; +messageEntityCashtag#4c4e743f offset:int length:int = MessageEntity; inputStickerSetShortName#861cc8a0 short_name:string = InputStickerSet; inputStickerSetEmpty#ffb62b95 = InputStickerSet; decryptedMessageMediaVenue#8a0df56f lat:double long:double title:string address:string provider:string venue_id:string = DecryptedMessageMedia; diff --git a/td/generate/scheme/secret_api.tlo b/td/generate/scheme/secret_api.tlo index 1da19cb6a7c5bffe8c890bc3171d076dd6b585e8..d6be21615f0f4d5e908bcf1bc27e1160d2dd197b 100644 GIT binary patch delta 390 zcmZ3Jvm$SU1(PVZ&Ym5-zNy8T4QnPsl zdj}(!HF*Vl&gKQ22jn5V1nmF_V~3^&nuvuKy2uU;5esbo&LOuV4cJAs2&% delta 288 zcmZ3Hw9L>T4QnPsl zdj}(!HF*Vl&gKQ22jn5V1nmF_V~3^&nuvuKy2uU;5esbcMm7*r=KGKz2Bz2TP#9R$08XAxAn!6E~wJ&P1LVal1N3mPzr zPrh?V0m;Tic#M-+40X1{VyMsNELMRV$2{3FS9@|zr@~~BB~X7lEJ3nu@<)H^$rI8A zCbRTGr4JxUGfw{4pgg&uj|1XPiKS4N+bo5;ykMyeL}~&|73IGjTy5iM=bjS zQ53Kos=8o#3`FF@avd;Z(uy32K*0)#z~luhpjKR20d*K$#AGE@Bw-~~&6JfIxWoGj zRQaS;K2T?@!lQb^Dp)vtf*Sq-CZh0JWwOI+Xex+U4N*5~h0f#+tD%m5uo@BajMFzV zG3rBXbXbGO#)dV>niMB8szWs0SOW`+Ur?9Wtc6B(%GwHung?s4Y6RAGKt$%OgNSTC zvo3=XB4n{a#}k&k&{HFb4+2-^xMDb#eBLjf3&};{sY%6|C7{fdmzrFXngY|$IQgfa u`s53W91x>xHsDT~n|ExG31J0kWSD-DiBW$04;IERd|-XsKL|4_%mV<5Ty4Mr delta 910 zcmaJyw%2M2?sh8~g*6%G`<>q@7gheEO4;k~H|?Z+>UoFD zwYcn<*;scw*4<5d7+~6r(w$ec&&)n2?Y921z!-555KVYtRnG?|zd%n!AW;RbTL2<10N=!)kN{a^kTm|hzJ&oK|0OS-W6ves>J zfei^h0|v>~v>24UgW&abU`rRJ)Duxk?Tm8R@>h|^=)ZC&l(uKVZ|A{!RYsmgq61FJ zhDc6AV?ka;z$sIbpiC}#nPUGTV=+SPG2)!WhUK|2z zcd>DluqKct$Ocdn6uFT2A3GC!+u10R&B+FS-Xy-Bm^))S$R=sWUXvu+^TGlDMd(C| zo_Z;@h1!Kwm6tw35E@qu^~Y0C>hD&DyXJ7m#Sg~#8(SMIt1Ft7f61+3 F7vJEAY%Tx* diff --git a/td/generate/scheme/telegram_api.tl b/td/generate/scheme/telegram_api.tl index 54939ac0..8f4829cc 100644 --- a/td/generate/scheme/telegram_api.tl +++ b/td/generate/scheme/telegram_api.tl @@ -155,6 +155,7 @@ messageActionPaymentSent#40699cd0 currency:string total_amount:long = MessageAct messageActionPhoneCall#80e11a7f flags:# call_id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = MessageAction; messageActionScreenshotTaken#4792929b = MessageAction; messageActionCustomAction#fae69f56 message:string = MessageAction; +messageActionBotAllowed#abe9affe domain:string = MessageAction; dialog#e4def5db flags:# pinned:flags.2?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage = Dialog; @@ -307,8 +308,8 @@ updateRecentStickers#9a422c20 = Update; updateConfig#a229dd06 = Update; updatePtsChanged#3354678f = Update; updateChannelWebPage#40771900 channel_id:int webpage:WebPage pts:int pts_count:int = Update; -updateDialogPinned#d711a2cc flags:# pinned:flags.0?true peer:Peer = Update; -updatePinnedDialogs#d8caf68d flags:# order:flags.0?Vector = Update; +updateDialogPinned#19d27f3c flags:# pinned:flags.0?true peer:DialogPeer = Update; +updatePinnedDialogs#ea4cb65b flags:# order:flags.0?Vector = Update; updateBotWebhookJSON#8317c0c3 data:DataJSON = Update; updateBotWebhookJSONQuery#9b9240a6 query_id:long data:DataJSON timeout:int = Update; updateBotShippingQuery#e0cdc940 query_id:long user_id:int payload:bytes shipping_address:PostAddress = Update; @@ -346,7 +347,7 @@ upload.fileCdnRedirect#ea52fe5a dc_id:int file_token:bytes encryption_key:bytes dcOption#5d8c6cc flags:# ipv6:flags.0?true media_only:flags.1?true tcpo_only:flags.2?true cdn:flags.3?true static:flags.4?true id:int ip_address:string port:int = DcOption; -config#9c840964 flags:# phonecalls_enabled:flags.1?true default_p2p_contacts:flags.3?true date:int expires:int test_mode:Bool this_dc:int dc_options:Vector chat_size_max:int megagroup_size_max:int forwarded_count_max:int online_update_period_ms:int offline_blur_timeout_ms:int offline_idle_timeout_ms:int online_cloud_timeout_ms:int notify_cloud_delay_ms:int notify_default_delay_ms:int chat_big_size:int push_chat_period_ms:int push_chat_limit:int saved_gifs_limit:int edit_time_limit:int rating_e_decay:int stickers_recent_limit:int stickers_faved_limit:int channels_read_media_period:int tmp_sessions:flags.0?int pinned_dialogs_count_max:int call_receive_timeout_ms:int call_ring_timeout_ms:int call_connect_timeout_ms:int call_packet_timeout_ms:int me_url_prefix:string suggested_lang_code:flags.2?string lang_pack_version:flags.2?int disabled_features:Vector = Config; +config#e644ec1f flags:# phonecalls_enabled:flags.1?true default_p2p_contacts:flags.3?true preload_featured_stickers:flags.4?true ignore_phone_entities:flags.5?true revoke_pm_inbox:flags.6?true date:int expires:int test_mode:Bool this_dc:int dc_options:Vector chat_size_max:int megagroup_size_max:int forwarded_count_max:int online_update_period_ms:int offline_blur_timeout_ms:int offline_idle_timeout_ms:int online_cloud_timeout_ms:int notify_cloud_delay_ms:int notify_default_delay_ms:int chat_big_size:int push_chat_period_ms:int push_chat_limit:int saved_gifs_limit:int edit_time_limit:int revoke_time_limit:int revoke_pm_time_limit:int rating_e_decay:int stickers_recent_limit:int stickers_faved_limit:int channels_read_media_period:int tmp_sessions:flags.0?int pinned_dialogs_count_max:int call_receive_timeout_ms:int call_ring_timeout_ms:int call_connect_timeout_ms:int call_packet_timeout_ms:int me_url_prefix:string suggested_lang_code:flags.2?string lang_pack_version:flags.2?int = Config; nearestDc#8e1a1775 country:string this_dc:int nearest_dc:int = NearestDc; @@ -490,7 +491,7 @@ inputStickerSetEmpty#ffb62b95 = InputStickerSet; inputStickerSetID#9de7a269 id:long access_hash:long = InputStickerSet; inputStickerSetShortName#861cc8a0 short_name:string = InputStickerSet; -stickerSet#cd303b41 flags:# installed:flags.0?true archived:flags.1?true official:flags.2?true masks:flags.3?true id:long access_hash:long title:string short_name:string count:int hash:int = StickerSet; +stickerSet#5585a139 flags:# archived:flags.1?true official:flags.2?true masks:flags.3?true installed_date:flags.0?int id:long access_hash:long title:string short_name:string count:int hash:int = StickerSet; messages.stickerSet#b60a24a6 set:StickerSet packs:Vector documents:Vector = messages.StickerSet; @@ -527,6 +528,8 @@ messageEntityPre#73924be0 offset:int length:int language:string = MessageEntity; messageEntityTextUrl#76a6d327 offset:int length:int url:string = MessageEntity; messageEntityMentionName#352dca58 offset:int length:int user_id:int = MessageEntity; inputMessageEntityMentionName#208e68c9 offset:int length:int user_id:InputUser = MessageEntity; +messageEntityPhone#9b69e34b offset:int length:int = MessageEntity; +messageEntityCashtag#4c4e743f offset:int length:int = MessageEntity; inputChannelEmpty#ee8c1e86 = InputChannel; inputChannel#afeb712e channel_id:int access_hash:long = InputChannel; @@ -637,7 +640,7 @@ messages.featuredStickersNotModified#4ede3cf = messages.FeaturedStickers; messages.featuredStickers#f89d88e5 hash:int sets:Vector unread:Vector = messages.FeaturedStickers; messages.recentStickersNotModified#b17f890 = messages.RecentStickers; -messages.recentStickers#5ce20970 hash:int stickers:Vector = messages.RecentStickers; +messages.recentStickers#22f3afb3 hash:int packs:Vector stickers:Vector dates:Vector = messages.RecentStickers; messages.archivedStickers#4fcba9c8 count:int sets:Vector = messages.ArchivedStickers; @@ -830,6 +833,13 @@ inputMessageID#a676a322 id:int = InputMessage; inputMessageReplyTo#bad88395 id:int = InputMessage; inputMessagePinned#86872538 = InputMessage; +inputDialogPeer#fcaafeb7 peer:InputPeer = InputDialogPeer; + +dialogPeer#e56dbf05 peer:Peer = DialogPeer; + +messages.foundStickerSetsNotModified#d54b65d = messages.FoundStickerSets; +messages.foundStickerSets#b35bcea9 hash:int sets:Vector = messages.FoundStickerSets; + ---functions--- invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X; @@ -909,7 +919,7 @@ contacts.resetSaved#879537f1 = Bool; messages.getMessages#63c66506 id:Vector = messages.Messages; messages.getDialogs#191ba9c5 flags:# exclude_pinned:flags.0?true offset_date:int offset_id:int offset_peer:InputPeer limit:int = messages.Dialogs; messages.getHistory#dcbb8260 peer:InputPeer offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:int = messages.Messages; -messages.search#39e9ea0 flags:# peer:InputPeer q:string from_id:flags.0?InputUser filter:MessagesFilter min_date:int max_date:int offset_id:int add_offset:int limit:int max_id:int min_id:int = messages.Messages; +messages.search#8614ef68 flags:# peer:InputPeer q:string from_id:flags.0?InputUser filter:MessagesFilter min_date:int max_date:int offset_id:int add_offset:int limit:int max_id:int min_id:int hash:int = messages.Messages; messages.readHistory#e306d3a peer:InputPeer max_id:int = messages.AffectedMessages; messages.deleteHistory#1c015b09 flags:# just_clear:flags.0?true peer:InputPeer max_id:int = messages.AffectedHistory; messages.deleteMessages#e58e95d2 flags:# revoke:flags.0?true id:Vector = messages.AffectedMessages; @@ -940,7 +950,7 @@ messages.sendEncryptedService#32d439a4 peer:InputEncryptedChat random_id:long da messages.receivedQueue#55a5bb66 max_qts:int = Vector; messages.reportEncryptedSpam#4b0c8c0f peer:InputEncryptedChat = Bool; messages.readMessageContents#36a73f77 id:Vector = messages.AffectedMessages; -messages.getStickers#ae22e045 emoticon:string hash:string = messages.Stickers; +messages.getStickers#85cb5182 flags:# exclude_featured:flags.0?true emoticon:string hash:string = messages.Stickers; messages.getAllStickers#1c9618b1 hash:int = messages.AllStickers; messages.getWebPagePreview#8b68b0cc flags:# message:string entities:flags.3?Vector = MessageMedia; messages.exportChatInvite#7d885289 chat_id:int = ExportedChatInvite; @@ -968,7 +978,7 @@ messages.editMessage#5d1b8dd flags:# no_webpage:flags.1?true stop_geo_live:flags messages.editInlineBotMessage#b0e08243 flags:# no_webpage:flags.1?true stop_geo_live:flags.12?true id:InputBotInlineMessageID message:flags.11?string reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector geo_point:flags.13?InputGeoPoint = Bool; messages.getBotCallbackAnswer#810a9fec flags:# game:flags.1?true peer:InputPeer msg_id:int data:flags.0?bytes = messages.BotCallbackAnswer; messages.setBotCallbackAnswer#d58f130a flags:# alert:flags.1?true query_id:long message:flags.0?string url:flags.2?string cache_time:int = Bool; -messages.getPeerDialogs#2d9776b9 peers:Vector = messages.PeerDialogs; +messages.getPeerDialogs#e470bcfd peers:Vector = messages.PeerDialogs; messages.saveDraft#bc39e14b flags:# no_webpage:flags.1?true reply_to_msg_id:flags.0?int peer:InputPeer message:string entities:flags.3?Vector = Bool; messages.getAllDrafts#6a3f8d65 = Updates; messages.getFeaturedStickers#2dacca4f hash:int = messages.FeaturedStickers; @@ -986,8 +996,8 @@ messages.getInlineGameHighScores#f635e1b id:InputBotInlineMessageID user_id:Inpu messages.getCommonChats#d0a48c4 user_id:InputUser max_id:int limit:int = messages.Chats; messages.getAllChats#eba80ff0 except_ids:Vector = messages.Chats; messages.getWebPage#32ca8f91 url:string hash:int = WebPage; -messages.toggleDialogPin#3289be6a flags:# pinned:flags.0?true peer:InputPeer = Bool; -messages.reorderPinnedDialogs#959ff644 flags:# force:flags.0?true order:Vector = Bool; +messages.toggleDialogPin#a731e257 flags:# pinned:flags.0?true peer:InputDialogPeer = Bool; +messages.reorderPinnedDialogs#5b51d63f flags:# force:flags.0?true order:Vector = Bool; messages.getPinnedDialogs#e254d64e = messages.PeerDialogs; messages.setBotShippingResults#e5f672fa flags:# query_id:long error:flags.0?string shipping_options:flags.1?Vector = Bool; messages.setBotPrecheckoutResults#9c2dd95 flags:# success:flags.1?true query_id:long error:flags.0?string = Bool; @@ -997,9 +1007,10 @@ messages.getFavedStickers#21ce0b0e hash:int = messages.FavedStickers; messages.faveSticker#b9ffc55b id:InputDocument unfave:Bool = Bool; messages.getUnreadMentions#46578472 peer:InputPeer offset_id:int add_offset:int limit:int max_id:int min_id:int = messages.Messages; messages.readMentions#f0189d3 peer:InputPeer = messages.AffectedHistory; -messages.getRecentLocations#249431e2 peer:InputPeer limit:int = messages.Messages; +messages.getRecentLocations#bbc45b09 peer:InputPeer limit:int hash:int = messages.Messages; messages.sendMultiMedia#2095512f flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int multi_media:Vector = Updates; messages.uploadEncryptedFile#5057c497 peer:InputEncryptedChat file:InputEncryptedFile = EncryptedFile; +messages.searchStickerSets#c2b7d08b flags:# exclude_featured:flags.0?true q:string hash:int = messages.FoundStickerSets; updates.getState#edd4882a = updates.State; updates.getDifference#25939651 flags:# pts:int pts_total_limit:flags.0?int date:int qts:int = updates.Difference; diff --git a/td/generate/scheme/telegram_api.tlo b/td/generate/scheme/telegram_api.tlo index 7ae937edba233d3d9dffe08ed55752a57e221e41..c2d1060b6e6a3a975a318ad57a9722dfecfcbed4 100644 GIT binary patch delta 4184 zcmaJ^eQZRf6<-DSz~NW4!HBKlk`fO53;_kX8w<#iU|^+t*$uj{I@L*=OS#&Z-sb7Pw1JiMVBX|aeiQ%U?({Vsr_)G%)lh1`qo65iwsHKsYCK@J(Na9s3@*8gGJjCIW*|;ZAstB zoknD8G}A@T9hsqiNgF77>PY6E`NaL|Y&~;yk~zr`FlhGF%*YcJs)F0<%;Oa7ErIr6 zOPgwxDQWKFjz9F-&14kj1=yeq8ps-@+%on&0b$cjw>J=M@pu$hldC1D7*Hf&#X}X4 zkD{ImZT-Lmjnk zUBqHhV?=U|9%6J6bLni5@S{ac+_4y>v`Y?se|-^-EC!j{8c>;(a(>A$QPd4#rwC5U zJtOLJWdEm1p_amRrA)oE6wXtuVo8Q5jx14!nwHwTOIU42moWX>GUm!(##{}Qu{4a7 zLA~xrO50p2<6a2{Et$>9CN?eMQr!;v*21~FUl%PomW`$qAOV$QY)dC>W3>B7OP;#!?udGh+0J)E9C^-xSF}?U&RzgRzVjva%?qo z5nByf9QzSxD3qKcU)A?ymvs)LdaL+f%Am#{C<>furldacUj&ET$>v zIvAvJ$?I9HW68P2FfBRiB(ad|hZaHoH+3H;FX=8~vp5qZa}lm$DekQTY3fXjsB%+t_+b9*1Aa1w^-Hqb>s4F^Eq9TP&@Pf28q>%;Yz!lxlZFd* zf5X;I>b*$Q8+r-UNxw#&uKrDGY*Sgly_;AfN81G4X;(i0rn7q8^6jk5m39bHyXWm} zFGF^SQtYrpmrK`Ic7PREcB|h2|7JK$r5`)Udp<*e>H0<~e)YA7vBJw;OoAJW#3%d$z=~v6%aj%wO zV4E+v)#q~Wb*p`1Fpw9{#IsMZ%>H=edP98d6*SS_m<>)Fm&I!g;NOQ*D{LjK7To8exTqe%rcaFkwqw1>Eh)JZHnZESv>LcuvCAU&C5_i|4G`I})oO78#r7sEp_ZwI8B_dMe4raHo+=@ju>i z?Fe>eb5?ZzkTlDrgjziZTuPJvG<2bxua_i3*<4ufGj#J$PbGw0?lI3--PzHAEi<{O zk-V-9_};J8mK>bPIkNOt(g4S7t`_+Af0#I45Y)CK~5* z&0u>um3a3X=`IT>Egh}x>Bn&}pmi3C9g_clm{_$ZU~7(gP1718Hjg`F%SP+ c^H&yd^)vWqKQ2FuhfBF*nfvHk!nM!)A3$S+RR910 delta 3444 zcmaJ@eQZAO+JgjY*zx78}SGf+1$j zBs6&&YEzX~rZ;dR&1Ei%+Ehhd+J|^dVp}4ys-zAzYgp1Q-8{sksj9ZHQ5H@4WAD9t zuahN8{D*bk`TCu&d+zOf)i(Q6+sb>tsN9~zexJR!^5 zDmp=ZXz`0`BtMu}++O+4b1R<>cXziP4L7t$J5F@vMn{ow1ZZt})qRHuS+t{Mt;3M5@2 z78Zs&y4$|r84evj5^js0J{2Y>zbJLOPqe?w6F=3MCtG*CFk*O7r;a%CRNwJ{mEphF zR7nz1yL$ihmya{n>X-BYUr5h=sVy%~6{u&(^eWLvL5;kxI4Cvn!Jr@-MI-)OHBN&t z!Zd(6s3}a|@=&eRtq>)uM`cRfNGX))AC+y~0pQ6rl%VtmtRT~)R;n;Nsw|D*`)Hmu zd2s6)=KUiE6ALgHDW%N85D1i$Ofv&Gms%LpH0MZT)zsmkG3Mvon4fYoW1gkMl5WdO z3q!YARpPgqulu)I1pZ!ywBBna@sE=fr8+&ApMX`b!+w%{nZ?cW&`zhi1WFcp85yvyWNN3!=z>oXxLQZlK$MwgBI{k|{jtQod znP??}e=y*y6O71AbW&jdq)ds}WP}nACl$^Kp!Z{aqT-)gO^(|C+4V+;aqjZFqaE!( z44?W|IGSU8qmlr{X6xwcj<$7nhOw<$C?av$j(w{jhKa|(OCkp(;*Y!W!&2~>8vyMR zcx~n>Hs+t4|5ph{BnX&7EiFMT*W3>mw?f1u@IyC9CPmW3`PzOv#>)f`6?vZmPE|uM z<;^?=Zc0gI;HOlyjO!)KxLZd#=XuMahU%RupJ!V^pkpobS9&Uca zGf&t@4SLowDTz0+7-rUGeXoZes+L#}GNn@Mp_Nju4UG5Ne-+A!ZQz!J8+b;uTnqJ# zWK29MxJj^?B|ad7Y%`Xuv1KecQUT2rJY_*Z&0HB*Xs{aXQO)ZkuPXdpDZA;@==GP|IxNj?(#pgr4odTIb!) zu_T8OHzU4S3vMT$n?-G^s|9IkX|$HROV+{^EkLY}PfqZpf~hh+xD~%~p;8APtlPm0 z(Yu2+W3HNVJ@1cRO$E=@^A--(GZd1%q+q%heCU4$Zc;d>m%+_By6V+;w~>)KhNga? z0S2hPxHB7awr9ONdAWvm^0Ov3g1mI%Esfw=TH4#VT+xObmn-F91?r|rt_OXdggG&-_oZsa)B35 z-n*RbvAsME(>BFFueHJz!MrWCp?#dh-~sSk%q9^1{fNW+z>W_Ou({W~&w+=&g;6K_ zt{sFPFkPVTLedi7h8F(Zg*>5Dv;GW@6=;WE1!vwmV*uYSdXaZ{QhX^C$LLD0rsLcfJ37+E9ODLn1pfLl0J YApYRDFKxQ02)!6A7Tnqu{bWAzKk?y&NdN!< diff --git a/td/mtproto/Handshake.cpp b/td/mtproto/Handshake.cpp index 5179c5f3..e5ed7599 100644 --- a/td/mtproto/Handshake.cpp +++ b/td/mtproto/Handshake.cpp @@ -56,7 +56,7 @@ Result AuthKeyHandshake::fill_data_with_hash(uint8 *data_with_hash, cons } Status AuthKeyHandshake::on_res_pq(Slice message, Callback *connection, PublicRsaKeyInterface *public_rsa_key) { - TRY_RESULT(res_pq, fetch_result(message)); + TRY_RESULT(res_pq, fetch_result(message)); if (res_pq->nonce_ != nonce) { return Status::Error("Nonce mismatch"); } @@ -272,7 +272,7 @@ Status AuthKeyHandshake::on_start(Callback *connection) { return Status::Error(PSLICE() << "on_start called after start " << tag("state", state_)); } Random::secure_bytes(nonce.raw, sizeof(nonce)); - send(connection, create_storer(mtproto_api::req_pq(nonce))); + send(connection, create_storer(mtproto_api::req_pq_multi(nonce))); state_ = ResPQ; return Status::OK(); diff --git a/td/mtproto/PingConnection.h b/td/mtproto/PingConnection.h index 785e665c..b726e48d 100644 --- a/td/mtproto/PingConnection.h +++ b/td/mtproto/PingConnection.h @@ -41,7 +41,7 @@ class PingConnection : private RawConnection::Callback { if (!was_ping_) { UInt128 nonce; Random::secure_bytes(nonce.raw, sizeof(nonce)); - raw_connection_->send_no_crypto(PacketStorer(1, create_storer(mtproto_api::req_pq(nonce)))); + raw_connection_->send_no_crypto(PacketStorer(1, create_storer(mtproto_api::req_pq_multi(nonce)))); was_ping_ = true; } return raw_connection_->flush(AuthKey(), *this); diff --git a/td/telegram/ConfigManager.cpp b/td/telegram/ConfigManager.cpp index f0617f8f..b261720c 100644 --- a/td/telegram/ConfigManager.cpp +++ b/td/telegram/ConfigManager.cpp @@ -706,6 +706,12 @@ void ConfigManager::process_config(tl_object_ptr config) { shared_config.set_option_empty("notify_cloud_delay_ms"); shared_config.set_option_empty("notify_default_delay_ms"); + if (is_from_main_dc) { + for (auto &feature : shared_config.get_options("disabled_")) { + shared_config.set_option_empty(feature.first); + } + } + // TODO implement online status updates // shared_config.set_option_integer("online_update_period_ms", config->online_update_period_ms_); // shared_config.set_option_integer("offline_blur_timeout_ms", config->offline_blur_timeout_ms_); @@ -716,19 +722,6 @@ void ConfigManager::process_config(tl_object_ptr config) { // shared_config.set_option_integer("push_chat_period_ms", config->push_chat_period_ms_); // shared_config.set_option_integer("push_chat_limit", config->push_chat_limit_); - - if (is_from_main_dc) { - auto old_disabled_features = shared_config.get_options("disabled_"); - for (auto &feature : config->disabled_features_) { - string option_name = "disabled_" + feature->feature_; - shared_config.set_option_string(option_name, feature->description_); - old_disabled_features.erase(option_name); - } - - for (auto &feature : old_disabled_features) { - shared_config.set_option_empty(feature.first); - } - } } } // namespace td diff --git a/td/telegram/ContactsManager.cpp b/td/telegram/ContactsManager.cpp index eea55f78..d88a43ae 100644 --- a/td/telegram/ContactsManager.cpp +++ b/td/telegram/ContactsManager.cpp @@ -7433,7 +7433,7 @@ void ContactsManager::on_update_chat_active(Chat *c, ChatId chat_id, bool is_act } } -void ContactsManager::on_update_chat_migrated_to(Chat *c, ChatId chat_id, ChannelId migrated_to_channel_id) { +void ContactsManager::on_update_chat_migrated_to_channel_id(Chat *c, ChatId chat_id, ChannelId migrated_to_channel_id) { if (c->migrated_to_channel_id != migrated_to_channel_id && migrated_to_channel_id.is_valid()) { LOG_IF(ERROR, c->migrated_to_channel_id.is_valid()) << "Group upgraded to supergroup has changed from " << c->migrated_to_channel_id << " to " @@ -8757,7 +8757,7 @@ void ContactsManager::on_chat_update(telegram_api::chat &chat) { bool is_active = 0 == (chat.flags_ & CHAT_FLAG_IS_DEACTIVATED); - ChannelId migrated_to; + ChannelId migrated_to_channel_id; if (chat.flags_ & CHAT_FLAG_WAS_MIGRATED) { switch (chat.migrated_to_->get_id()) { case telegram_api::inputChannelEmpty::ID: { @@ -8766,20 +8766,20 @@ void ContactsManager::on_chat_update(telegram_api::chat &chat) { } case telegram_api::inputChannel::ID: { auto input_channel = move_tl_object_as(chat.migrated_to_); - migrated_to = ChannelId(input_channel->channel_id_); - if (!have_channel(migrated_to)) { - if (!migrated_to.is_valid()) { - LOG(ERROR) << "Receive invalid " << migrated_to << " in " << debug_str; + migrated_to_channel_id = ChannelId(input_channel->channel_id_); + if (!have_channel(migrated_to_channel_id)) { + if (!migrated_to_channel_id.is_valid()) { + LOG(ERROR) << "Receive invalid " << migrated_to_channel_id << " in " << debug_str; } else { // temporarily create the channel - Channel *c = add_channel(migrated_to); + Channel *c = add_channel(migrated_to_channel_id); c->access_hash = input_channel->access_hash_; c->title = chat.title_; c->status = DialogParticipantStatus::Left(); c->is_megagroup = true; // we definitely need to call update_channel, because client should know about every added channel - update_channel(c, channel_id); + update_channel(c, migrated_to_channel_id); // get info about the channel td_->create_handler(Promise<>())->send(std::move(input_channel)); @@ -8807,8 +8807,8 @@ void ContactsManager::on_chat_update(telegram_api::chat &chat) { on_update_chat_rights(c, chat_id, is_creator, is_administrator, everyone_is_administrator); on_update_chat_photo(c, chat_id, std::move(chat.photo_)); on_update_chat_active(c, chat_id, is_active); - on_update_chat_migrated_to(c, chat_id, migrated_to); - LOG_IF(ERROR, !is_active && !migrated_to.is_valid()) << chat_id << " is deactivated in " << debug_str; + on_update_chat_migrated_to_channel_id(c, chat_id, migrated_to_channel_id); + LOG_IF(ERROR, !is_active && !migrated_to_channel_id.is_valid()) << chat_id << " is deactivated in " << debug_str; update_chat(c, chat_id); } @@ -8833,7 +8833,7 @@ void ContactsManager::on_chat_update(telegram_api::chatForbidden &chat) { on_update_chat_left(c, chat_id, true, true); if (is_uninited) { on_update_chat_active(c, chat_id, true); - on_update_chat_migrated_to(c, chat_id, ChannelId()); + on_update_chat_migrated_to_channel_id(c, chat_id, ChannelId()); } else { // leave active and migrated to as is } diff --git a/td/telegram/ContactsManager.h b/td/telegram/ContactsManager.h index 3af87691..97a2f098 100644 --- a/td/telegram/ContactsManager.h +++ b/td/telegram/ContactsManager.h @@ -818,7 +818,7 @@ class ContactsManager : public Actor { bool everyone_is_administrator); void on_update_chat_title(Chat *c, ChatId chat_id, string &&title); void on_update_chat_active(Chat *c, ChatId chat_id, bool is_active); - void on_update_chat_migrated_to(Chat *c, ChatId chat_id, ChannelId migrated_to_channel_id); + void on_update_chat_migrated_to_channel_id(Chat *c, ChatId chat_id, ChannelId migrated_to_channel_id); bool on_update_chat_full_participants_short(ChatFull *chat_full, ChatId chat_id, int32 version); void on_update_chat_full_participants(ChatFull *chat_full, ChatId chat_id, vector participants, diff --git a/td/telegram/DialogId.cpp b/td/telegram/DialogId.cpp index 116a9f13..7ea81859 100644 --- a/td/telegram/DialogId.cpp +++ b/td/telegram/DialogId.cpp @@ -103,48 +103,51 @@ DialogId::DialogId(SecretChatId chat_id) { } } -DialogId::DialogId(const tl_object_ptr &peer) { +DialogId::DialogId(const tl_object_ptr &dialog_peer) { + id = get_peer_id(dialog_peer->peer_); +} + +DialogId::DialogId(const tl_object_ptr &peer) : id(get_peer_id(peer)) { +} + +int64 DialogId::get_peer_id(const tl_object_ptr &peer) { CHECK(peer != nullptr); - int constructor_id = peer->get_id(); - switch (constructor_id) { + switch (peer->get_id()) { case telegram_api::peerUser::ID: { auto peer_user = static_cast(peer.get()); UserId user_id(peer_user->user_id_); if (!user_id.is_valid()) { LOG(ERROR) << "Receive invalid " << user_id; - id = 0; - } else { - id = static_cast(user_id.get()); + return 0; } - return; + + return static_cast(user_id.get()); } case telegram_api::peerChat::ID: { auto peer_chat = static_cast(peer.get()); ChatId chat_id(peer_chat->chat_id_); if (!chat_id.is_valid()) { LOG(ERROR) << "Receive invalid " << chat_id; - id = 0; - } else { - id = -static_cast(chat_id.get()); + return 0; } - return; + + return -static_cast(chat_id.get()); } case telegram_api::peerChannel::ID: { auto peer_channel = static_cast(peer.get()); ChannelId channel_id(peer_channel->channel_id_); if (!channel_id.is_valid()) { LOG(ERROR) << "Receive invalid " << channel_id; - id = 0; - } else { - id = MAX_CHANNEL_ID - static_cast(channel_id.get()); + return 0; } - return; + + return MAX_CHANNEL_ID - static_cast(channel_id.get()); } default: UNREACHABLE(); + return 0; } - id = 0; } } // namespace td diff --git a/td/telegram/DialogId.h b/td/telegram/DialogId.h index 32fd10a8..ac11ced8 100644 --- a/td/telegram/DialogId.h +++ b/td/telegram/DialogId.h @@ -34,6 +34,8 @@ class DialogId { int64 id = 0; + static int64 get_peer_id(const tl_object_ptr &peer); + public: using UnderlyingType = decltype(id); DialogId() = default; @@ -43,6 +45,7 @@ class DialogId { template ::value>> DialogId(T dialog_id) = delete; + explicit DialogId(const tl_object_ptr &dialog_peer); explicit DialogId(const tl_object_ptr &peer); explicit DialogId(UserId user_id); explicit DialogId(ChatId chat_id); diff --git a/td/telegram/MessageEntity.cpp b/td/telegram/MessageEntity.cpp index 08ead40e..cbe9f13f 100644 --- a/td/telegram/MessageEntity.cpp +++ b/td/telegram/MessageEntity.cpp @@ -987,17 +987,15 @@ vector find_entities(Slice text, bool skip_bot_commands, bool onl entities.emplace_back(MessageEntity::Type::Mention, narrow_cast(mention.begin() - text.begin()), narrow_cast(mention.size())); } - } - if (!skip_bot_commands && !only_urls) { - auto bot_commands = find_bot_commands(text); - for (auto &bot_command : bot_commands) { - entities.emplace_back(MessageEntity::Type::BotCommand, narrow_cast(bot_command.begin() - text.begin()), - narrow_cast(bot_command.size())); + if (!skip_bot_commands) { + auto bot_commands = find_bot_commands(text); + for (auto &bot_command : bot_commands) { + entities.emplace_back(MessageEntity::Type::BotCommand, narrow_cast(bot_command.begin() - text.begin()), + narrow_cast(bot_command.size())); + } } - } - if (!only_urls) { auto hashtags = find_hashtags(text); for (auto &hashtag : hashtags) { entities.emplace_back(MessageEntity::Type::Hashtag, narrow_cast(hashtag.begin() - text.begin()), @@ -1704,6 +1702,12 @@ vector get_message_entities(const ContactsManager *contacts_manag entities.emplace_back(MessageEntity::Type::Hashtag, entity_hashtag->offset_, entity_hashtag->length_); break; } + case telegram_api::messageEntityCashtag::ID: + // skip for now + break; + case telegram_api::messageEntityPhone::ID: + // skip for now + break; case telegram_api::messageEntityBotCommand::ID: { auto entity_bot_command = static_cast(entity.get()); entities.emplace_back(MessageEntity::Type::BotCommand, entity_bot_command->offset_, @@ -1796,6 +1800,12 @@ vector get_message_entities(vectornet_query_creator().create(create_storer(telegram_api::messages_getPeerDialogs( - td->messages_manager_->get_input_peers({dialog_id}, AccessRights::Read))))); + td->messages_manager_->get_input_dialog_peers({dialog_id}, AccessRights::Read))))); } void on_result(uint64 id, BufferSlice packet) override { @@ -219,7 +219,7 @@ class GetDialogsQuery : public Td::ResultHandler { void send(vector &&dialog_ids) { send_query(G()->net_query_creator().create(create_storer(telegram_api::messages_getPeerDialogs( - td->messages_manager_->get_input_peers(dialog_ids, AccessRights::Read))))); + td->messages_manager_->get_input_dialog_peers(dialog_ids, AccessRights::Read))))); } void on_result(uint64 id, BufferSlice packet) override { @@ -891,7 +891,7 @@ class ToggleDialogPinQuery : public Td::ResultHandler { void send(DialogId dialog_id, bool is_pinned) { dialog_id_ = dialog_id; is_pinned_ = is_pinned; - auto input_peer = td->messages_manager_->get_input_peer(dialog_id, AccessRights::Read); + auto input_peer = td->messages_manager_->get_input_dialog_peer(dialog_id, AccessRights::Read); if (input_peer == nullptr) { return; } @@ -937,7 +937,7 @@ class ReorderPinnedDialogsQuery : public Td::ResultHandler { void send(const vector &dialog_ids) { int32 flags = telegram_api::messages_reorderPinnedDialogs::FORCE_MASK; send_query(G()->net_query_creator().create(create_storer(telegram_api::messages_reorderPinnedDialogs( - flags, true /*ignored*/, td->messages_manager_->get_input_peers(dialog_ids, AccessRights::Read))))); + flags, true /*ignored*/, td->messages_manager_->get_input_dialog_peers(dialog_ids, AccessRights::Read))))); } void on_result(uint64 id, BufferSlice packet) override { @@ -1389,7 +1389,7 @@ class SearchMessagesQuery : public Td::ResultHandler { send_query(G()->net_query_creator().create(create_storer(telegram_api::messages_search( flags, std::move(input_peer), query, std::move(sender_input_user), MessagesManager::get_input_messages_filter(filter), 0, std::numeric_limits::max(), - from_message_id.get_server_message_id().get(), offset, limit, std::numeric_limits::max(), 0)))); + from_message_id.get_server_message_id().get(), offset, limit, std::numeric_limits::max(), 0, 0)))); } } @@ -1556,7 +1556,7 @@ class GetRecentLocationsQuery : public Td::ResultHandler { random_id_ = random_id; send_query(G()->net_query_creator().create( - create_storer(telegram_api::messages_getRecentLocations(std::move(input_peer), limit)))); + create_storer(telegram_api::messages_getRecentLocations(std::move(input_peer), limit, 0)))); } void on_result(uint64 id, BufferSlice packet) override { @@ -3569,6 +3569,11 @@ static void store(const MessageContent *content, StorerT &storer) { store(m->message, storer); break; } + case MessageWebsiteConnected::ID: { + auto m = static_cast(content); + store(m->domain_name, storer); + break; + } default: UNREACHABLE(); } @@ -3869,6 +3874,12 @@ static void parse(unique_ptr &content, ParserT &parser) { content = std::move(m); break; } + case MessageWebsiteConnected::ID: { + auto m = make_unique(); + parse(m->domain_name, parser); + content = std::move(m); + break; + } default: UNREACHABLE(); } @@ -4724,6 +4735,7 @@ int32 MessagesManager::get_message_content_index_mask(const MessageContent *cont case MessageExpiredPhoto::ID: case MessageExpiredVideo::ID: case MessageCustomServiceAction::ID: + case MessageWebsiteConnected::ID: return 0; default: UNREACHABLE(); @@ -4789,6 +4801,37 @@ vector> MessagesManager::get_input_peers( return input_peers; } +tl_object_ptr MessagesManager::get_input_dialog_peer(DialogId dialog_id, + AccessRights access_rights) const { + switch (dialog_id.get_type()) { + case DialogType::User: + case DialogType::Chat: + case DialogType::Channel: + case DialogType::None: + return make_tl_object(get_input_peer(dialog_id, access_rights)); + case DialogType::SecretChat: + return nullptr; + default: + UNREACHABLE(); + return nullptr; + } +} + +vector> MessagesManager::get_input_dialog_peers( + const vector &dialog_ids, AccessRights access_rights) const { + vector> input_dialog_peers; + input_dialog_peers.reserve(dialog_ids.size()); + for (auto &dialog_id : dialog_ids) { + auto input_dialog_peer = get_input_dialog_peer(dialog_id, access_rights); + if (input_dialog_peer == nullptr) { + LOG(ERROR) << "Have no access to " << dialog_id; + continue; + } + input_dialog_peers.push_back(std::move(input_dialog_peer)); + } + return input_dialog_peers; +} + bool MessagesManager::have_input_peer(DialogId dialog_id, AccessRights access_rights) const { switch (dialog_id.get_type()) { case DialogType::User: { @@ -6984,6 +7027,7 @@ bool MessagesManager::is_service_message_content(int32 content_type) { case MessagePaymentSuccessful::ID: case MessageContactRegistered::ID: case MessageCustomServiceAction::ID: + case MessageWebsiteConnected::ID: return true; default: UNREACHABLE(); @@ -7053,6 +7097,7 @@ string MessagesManager::get_search_text(const Message *m) { case MessageExpiredPhoto::ID: case MessageExpiredVideo::ID: case MessageCustomServiceAction::ID: + case MessageWebsiteConnected::ID: return ""; default: UNREACHABLE(); @@ -7100,6 +7145,7 @@ bool MessagesManager::is_allowed_media_group_content(int32 content_type) { case MessagePaymentSuccessful::ID: case MessageContactRegistered::ID: case MessageCustomServiceAction::ID: + case MessageWebsiteConnected::ID: return false; default: UNREACHABLE(); @@ -8374,6 +8420,10 @@ tl_object_ptr MessagesManager::get_message_content_objec const MessageCustomServiceAction *m = static_cast(content); return make_tl_object(m->message); } + case MessageWebsiteConnected::ID: { + const MessageWebsiteConnected *m = static_cast(content); + return make_tl_object(m->domain_name); + } default: UNREACHABLE(); return nullptr; @@ -13955,6 +14005,7 @@ SecretInputMedia MessagesManager::get_secret_input_media(const MessageContent *c case MessageExpiredPhoto::ID: case MessageExpiredVideo::ID: case MessageCustomServiceAction::ID: + case MessageWebsiteConnected::ID: break; default: UNREACHABLE(); @@ -14125,6 +14176,7 @@ tl_object_ptr MessagesManager::get_input_media( case MessageExpiredPhoto::ID: case MessageExpiredVideo::ID: case MessageCustomServiceAction::ID: + case MessageWebsiteConnected::ID: break; default: UNREACHABLE(); @@ -14192,6 +14244,7 @@ void MessagesManager::delete_message_content_thumbnail(MessageContent *content) case MessageExpiredPhoto::ID: case MessageExpiredVideo::ID: case MessageCustomServiceAction::ID: + case MessageWebsiteConnected::ID: break; default: UNREACHABLE(); @@ -14480,6 +14533,7 @@ Status MessagesManager::can_send_message_content(DialogId dialog_id, const Messa case MessageExpiredPhoto::ID: case MessageExpiredVideo::ID: case MessageCustomServiceAction::ID: + case MessageWebsiteConnected::ID: UNREACHABLE(); } return Status::OK(); @@ -14872,6 +14926,8 @@ void MessagesManager::add_message_dependencies(Dependencies &dependencies, Dialo break; case MessageCustomServiceAction::ID: break; + case MessageWebsiteConnected::ID: + break; default: UNREACHABLE(); break; @@ -16352,6 +16408,7 @@ bool MessagesManager::can_edit_message(DialogId dialog_id, const Message *m, boo case MessageExpiredPhoto::ID: case MessageExpiredVideo::ID: case MessageCustomServiceAction::ID: + case MessageWebsiteConnected::ID: return false; default: UNREACHABLE(); @@ -16548,6 +16605,7 @@ void MessagesManager::edit_message_caption(FullMessageId full_message_id, case MessageExpiredPhoto::ID: case MessageExpiredVideo::ID: case MessageCustomServiceAction::ID: + case MessageWebsiteConnected::ID: return promise.set_error(Status::Error(400, "There is no caption in the message to edit")); default: UNREACHABLE(); @@ -18038,6 +18096,7 @@ FullMessageId MessagesManager::on_send_message_success(int64 random_id, MessageI case MessageExpiredPhoto::ID: case MessageExpiredVideo::ID: case MessageCustomServiceAction::ID: + case MessageWebsiteConnected::ID: LOG(ERROR) << "Receive new file " << new_file_id << " in a sent message of the type " << content_type; break; default: @@ -20544,6 +20603,7 @@ unique_ptr MessagesManager::dup_message_content(DialogId dialog_ case MessageExpiredPhoto::ID: case MessageExpiredVideo::ID: case MessageCustomServiceAction::ID: + case MessageWebsiteConnected::ID: return nullptr; default: UNREACHABLE(); @@ -20706,6 +20766,10 @@ unique_ptr MessagesManager::get_message_action_content( auto custom_action = move_tl_object_as(action); return make_unique(std::move(custom_action->message_)); } + case telegram_api::messageActionBotAllowed::ID: { + auto bot_allowed = move_tl_object_as(action); + return make_unique(std::move(bot_allowed->domain_)); + } default: UNREACHABLE(); } @@ -22192,6 +22256,14 @@ bool MessagesManager::update_message_content(DialogId dialog_id, const Message * } break; } + case MessageWebsiteConnected::ID: { + auto old_ = static_cast(old_content.get()); + auto new_ = static_cast(new_content.get()); + if (old_->domain_name != new_->domain_name) { + need_update = true; + } + break; + } case MessageUnsupported::ID: break; default: diff --git a/td/telegram/MessagesManager.h b/td/telegram/MessagesManager.h index 7b365df0..59359766 100644 --- a/td/telegram/MessagesManager.h +++ b/td/telegram/MessagesManager.h @@ -612,6 +612,20 @@ class MessageCustomServiceAction : public MessageContent { } }; +class MessageWebsiteConnected : public MessageContent { + public: + string domain_name; + + MessageWebsiteConnected() = default; + explicit MessageWebsiteConnected(string &&domain_name) : domain_name(std::move(domain_name)) { + } + + static const int32 ID = 37; + int32 get_id() const override { + return ID; + } +}; + class InputMessageText { public: FormattedText text; @@ -834,6 +848,12 @@ class MessagesManager : public Actor { vector> get_input_peers(const vector &dialog_ids, AccessRights access_rights) const; + tl_object_ptr get_input_dialog_peer(DialogId dialog_id, + AccessRights access_rights) const; + + vector> get_input_dialog_peers(const vector &dialog_ids, + AccessRights access_rights) const; + tl_object_ptr get_input_encrypted_chat(DialogId dialog_id, AccessRights access_rights) const; diff --git a/td/telegram/StickersManager.cpp b/td/telegram/StickersManager.cpp index 3b9683d5..9bd26135 100644 --- a/td/telegram/StickersManager.cpp +++ b/td/telegram/StickersManager.cpp @@ -1354,7 +1354,7 @@ int64 StickersManager::on_get_sticker_set(tl_object_ptrid_; StickerSet *s = add_sticker_set(set_id, set->access_hash_); - bool is_installed = (set->flags_ & telegram_api::stickerSet::INSTALLED_MASK) != 0; + bool is_installed = (set->flags_ & telegram_api::stickerSet::INSTALLED_DATE_MASK) != 0; bool is_archived = (set->flags_ & telegram_api::stickerSet::ARCHIVED_MASK) != 0; bool is_official = (set->flags_ & telegram_api::stickerSet::OFFICIAL_MASK) != 0; bool is_masks = (set->flags_ & telegram_api::stickerSet::MASKS_MASK) != 0; diff --git a/td/telegram/UpdatesManager.cpp b/td/telegram/UpdatesManager.cpp index 1bc943a8..148d0a04 100644 --- a/td/telegram/UpdatesManager.cpp +++ b/td/telegram/UpdatesManager.cpp @@ -478,6 +478,7 @@ bool UpdatesManager::is_acceptable_message(const telegram_api::Message *message_ case telegram_api::messageActionChatEditPhoto::ID: case telegram_api::messageActionChatDeletePhoto::ID: case telegram_api::messageActionCustomAction::ID: + case telegram_api::messageActionBotAllowed::ID: case telegram_api::messageActionHistoryClear::ID: case telegram_api::messageActionChannelCreate::ID: case telegram_api::messageActionPinMessage::ID: diff --git a/td/telegram/net/MtprotoHeader.cpp b/td/telegram/net/MtprotoHeader.cpp index 885c6158..3c41e2d1 100644 --- a/td/telegram/net/MtprotoHeader.cpp +++ b/td/telegram/net/MtprotoHeader.cpp @@ -18,7 +18,7 @@ class HeaderStorer { } template void store(StorerT &storer) const { - constexpr int32 LAYER = 75; + constexpr int32 LAYER = 76; using td::store; // invokeWithLayer#da9b0d0d {X:Type} layer:int query:!X = X;