Update layer to 111.

GitOrigin-RevId: 47862200a12f3b5b9e5058192d5e9a9cdca862aa
This commit is contained in:
levlam 2020-03-14 01:56:47 +03:00
parent b89034d78b
commit 3d07b45a21
15 changed files with 154 additions and 32 deletions

View File

@ -987,11 +987,13 @@ pageBlockRelatedArticles header:RichText articles:vector<pageBlockRelatedArticle
pageBlockMap location:location zoom:int32 width:int32 height:int32 caption:pageBlockCaption = PageBlock;
//@description Describes an instant view page for a web page @page_blocks Content of the web page
//@description Describes an instant view page for a web page
//@page_blocks Content of the web page
//@view_count Number of the instant view views; 0 if unknown
//@version Version of the instant view, currently can be 1 or 2
//@is_rtl True, if the instant view must be shown from right to left
//@is_full True, if the instant view contains the full page. A network request might be needed to get the full web page instant view
webPageInstantView page_blocks:vector<PageBlock> version:int32 is_rtl:Bool is_full:Bool = WebPageInstantView;
webPageInstantView page_blocks:vector<PageBlock> 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<string> = 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;

Binary file not shown.

View File

@ -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<bytes> = 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<BotInfo> 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<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 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<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 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<int> = 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<bytes> = Update;
updateDialogFilter#26ffde7d flags:# id:int filter:flags.0?DialogFilter = Update;
updateDialogFilterOrder#a5d72105 order:Vector<int> = 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<WebPageAttribute> = 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<string> = PhoneCallProtocol;
phone.phoneCall#ec82e140 phone_call:PhoneCall users:Vector<User> = phone.PhoneCall;
@ -996,7 +1002,7 @@ pageListOrderedItemBlocks#98dd8936 num:string blocks:Vector<PageBlock> = 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<PageBlock> photos:Vector<Photo> documents:Vector<Document> = Page;
page#98657f0d flags:# part:flags.0?true rtl:flags.1?true v2:flags.2?true url:string blocks:Vector<PageBlock> photos:Vector<Photo> documents:Vector<Document> 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<BankCardOpenUrl> = 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<InputPeer> include_peers:Vector<InputPeer> exclude_peers:Vector<InputPeer> = 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<MessageInteractionCounters> = stats.BroadcastStats;
---functions---
invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X;
@ -1341,6 +1365,10 @@ messages.sendScheduledMessages#bd38850a peer:InputPeer id:Vector<int> = Updates;
messages.deleteScheduledMessages#59ae2b16 peer:InputPeer id:Vector<int> = 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<InputStickerSet> = Bool;
messages.getDialogFilters#f19ed96d = Vector<DialogFilter>;
messages.getSuggestedDialogFilters#a29cd42c = Vector<DialogFilterSuggested>;
messages.updateDialogFilter#1ad4a04a flags:# id:int filter:flags.0?DialogFilter = Bool;
messages.updateDialogFiltersOrder#c563c1e4 order:Vector<int> = 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<BotCommand> = 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<InputStickerSetItem> = 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<InputStickerSetItem> = 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<InputFolderPeer> = 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;

Binary file not shown.

View File

@ -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<telegram_api::phoneCallProtocol> CallProtocol::as_telegram_api() c
if (udp_reflector) {
flags |= telegram_api::phoneCallProtocol::UDP_REFLECTOR_MASK;
}
return make_tl_object<telegram_api::phoneCallProtocol>(flags, udp_p2p, udp_reflector, min_layer, max_layer);
return make_tl_object<telegram_api::phoneCallProtocol>(flags, udp_p2p, udp_reflector, min_layer, max_layer,
vector<string>(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<td_api::callProtocol> CallProtocol::as_td_api() const {
return make_tl_object<td_api::callProtocol>(udp_p2p, udp_reflector, min_layer, max_layer);
return make_tl_object<td_api::callProtocol>(udp_p2p, udp_reflector, min_layer, max_layer,
vector<string>(library_versions));
}
CallConnection CallConnection::from_telegram_api(const telegram_api::phoneConnection &connection) {

View File

@ -32,6 +32,7 @@ struct CallProtocol {
bool udp_reflector{true};
int32 min_layer{65};
int32 max_layer{65};
vector<string> library_versions;
static CallProtocol from_telegram_api(const telegram_api::phoneCallProtocol &protocol);
tl_object_ptr<telegram_api::phoneCallProtocol> as_telegram_api() const;

View File

@ -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 <class ParserT>
@ -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 <class StorerT>
@ -8720,13 +8731,16 @@ void ContactsManager::on_get_chat_full(tl_object_ptr<telegram_api::ChatFull> &&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<telegram_api::ChatFull> &&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<telegram_api::ChatFull> &&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<td_api::supergroupFullInfo> 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());

View File

@ -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;

View File

@ -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 {

View File

@ -2017,4 +2017,13 @@ void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateLoginToken> upd
void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateTheme> update, bool /*force_apply*/) {
}
void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateDialogFilter> update, bool /*force_apply*/) {
}
void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateDialogFilterOrder> update, bool /*force_apply*/) {
}
void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateDialogFilters> update, bool /*force_apply*/) {
}
} // namespace td

View File

@ -291,6 +291,10 @@ class UpdatesManager : public Actor {
// unsupported updates
void on_update(tl_object_ptr<telegram_api::updateTheme> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateDialogFilter> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateDialogFilterOrder> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateDialogFilters> update, bool /*force_apply*/);
};
} // namespace td

View File

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

View File

@ -92,13 +92,15 @@ class GetWebPagePreviewQuery : public Td::ResultHandler {
class GetWebPageQuery : public Td::ResultHandler {
Promise<Unit> promise_;
WebPageId web_page_id_;
string url_;
public:
explicit GetWebPageQuery(Promise<Unit> &&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<telegram_api::webPageNotModified>(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<unique_ptr<WebPageBlock>> 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<GetWebPageQuery>(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<Unit> &&
}
LOG(INFO) << "Reload url \"" << url << '"';
td_->create_handler<GetWebPageQuery>(std::move(promise))->send(url, 0);
td_->create_handler<GetWebPageQuery>(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<td_api::webPageInstantView> WebPagesManager::get_web_page_instant_
}
return td_api::make_object<td_api::webPageInstantView>(
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;

View File

@ -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);

View File

@ -2657,7 +2657,7 @@ class CliClient final : public Actor {
send_request(td_api::make_object<td_api::closeSecretChat>(as_secret_chat_id(args)));
} else if (op == "cc" || op == "CreateCall") {
send_request(td_api::make_object<td_api::createCall>(
as_user_id(args), td_api::make_object<td_api::callProtocol>(true, true, 65, 65)));
as_user_id(args), td_api::make_object<td_api::callProtocol>(true, true, 65, 65, vector<string>{"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<td_api::discardCall>(as_call_id(call_id), as_bool(is_disconnected), 0, 0));
} else if (op == "ac" || op == "AcceptCall") {
send_request(td_api::make_object<td_api::acceptCall>(
as_call_id(args), td_api::make_object<td_api::callProtocol>(true, true, 65, 65)));
as_call_id(args), td_api::make_object<td_api::callProtocol>(true, true, 65, 65, vector<string>{"2.6"})));
} else if (op == "scr" || op == "SendCallRating") {
string call_id;
string rating;