Update layer to 134.

This commit is contained in:
levlam 2021-10-08 13:45:10 +03:00
parent f70498898b
commit 23775700ac
9 changed files with 145 additions and 73 deletions

View File

@ -118,8 +118,8 @@ chatForbidden#6592a1a7 id:long title:string = Chat;
channel#8261ac61 flags:# creator:flags.0?true left:flags.2?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true signatures:flags.11?true min:flags.12?true scam:flags.19?true has_link:flags.20?true has_geo:flags.21?true slowmode_enabled:flags.22?true call_active:flags.23?true call_not_empty:flags.24?true fake:flags.25?true gigagroup:flags.26?true id:long access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int restriction_reason:flags.9?Vector<RestrictionReason> admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int = Chat;
channelForbidden#17d493d5 flags:# broadcast:flags.5?true megagroup:flags.8?true id:long access_hash:long title:string until_date:flags.16?int = Chat;
chatFull#4dbdc099 flags:# can_set_username:flags.7?true has_scheduled:flags.8?true id:long about:string participants:ChatParticipants chat_photo:flags.2?Photo notify_settings:PeerNotifySettings exported_invite:flags.13?ExportedChatInvite bot_info:flags.3?Vector<BotInfo> pinned_msg_id:flags.6?int folder_id:flags.11?int call:flags.12?InputGroupCall ttl_period:flags.14?int groupcall_default_join_as:flags.15?Peer theme_emoticon:flags.16?string = ChatFull;
channelFull#e9b27a17 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_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true id:long 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:flags.23?ExportedChatInvite bot_info:Vector<BotInfo> migrated_from_chat_id:flags.4?long 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?long location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl_period:flags.24?int pending_suggestions:flags.25?Vector<string> groupcall_default_join_as:flags.26?Peer theme_emoticon:flags.27?string = ChatFull;
chatFull#46a6ffb4 flags:# can_set_username:flags.7?true has_scheduled:flags.8?true id:long about:string participants:ChatParticipants chat_photo:flags.2?Photo notify_settings:PeerNotifySettings exported_invite:flags.13?ExportedChatInvite bot_info:flags.3?Vector<BotInfo> pinned_msg_id:flags.6?int folder_id:flags.11?int call:flags.12?InputGroupCall ttl_period:flags.14?int groupcall_default_join_as:flags.15?Peer theme_emoticon:flags.16?string requests_pending:flags.17?int recent_requesters:flags.17?Vector<long> = ChatFull;
channelFull#59cff963 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_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true id:long 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:flags.23?ExportedChatInvite bot_info:Vector<BotInfo> migrated_from_chat_id:flags.4?long 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?long location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl_period:flags.24?int pending_suggestions:flags.25?Vector<string> groupcall_default_join_as:flags.26?Peer theme_emoticon:flags.27?string requests_pending:flags.28?int recent_requesters:flags.28?Vector<long> = ChatFull;
chatParticipant#c02d4007 user_id:long inviter_id:long date:int = ChatParticipant;
chatParticipantCreator#e46bcee4 user_id:long = ChatParticipant;
@ -178,6 +178,7 @@ messageActionInviteToGroupCall#502f92f7 call:InputGroupCall users:Vector<long> =
messageActionSetMessagesTTL#aa1afbfd period:int = MessageAction;
messageActionGroupCallScheduled#b3a07661 call:InputGroupCall schedule_date:int = MessageAction;
messageActionSetChatTheme#aa786345 emoticon:string = MessageAction;
messageActionChatJoinedByRequest#ebbca3cb = MessageAction;
dialog#2c171f72 flags:# pinned:flags.2?true unread_mark:flags.3?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 folder_id:flags.4?int = Dialog;
dialogFolder#71bd134c flags:# pinned:flags.2?true folder:Folder peer:Peer top_message:int unread_muted_peers_count:int unread_unmuted_peers_count:int unread_muted_messages_count:int unread_unmuted_messages_count:int = Dialog;
@ -368,6 +369,8 @@ updateChannelParticipant#985d3abb flags:# channel_id:long date:int actor_id:long
updateBotStopped#c4870a49 user_id:long date:int stopped:Bool qts:int = Update;
updateGroupCallConnection#b783982 flags:# presentation:flags.0?true params:DataJSON = Update;
updateBotCommands#4d712f2e peer:Peer bot_id:long commands:Vector<BotCommand> = Update;
updatePendingJoinRequests#7063c3db peer:Peer requests_pending:int recent_requesters:Vector<long> = Update;
updateBotChatInviteRequester#11dfa986 peer:Peer date:int user_id:long about:string invite:ExportedChatInvite qts:int = Update;
updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;
@ -539,10 +542,10 @@ auth.passwordRecovery#137948a5 email_pattern:string = auth.PasswordRecovery;
receivedNotifyMessage#a384b779 id:int flags:int = ReceivedNotifyMessage;
chatInviteExported#b18105e8 flags:# revoked:flags.0?true permanent:flags.5?true link:string admin_id:long date:int start_date:flags.4?int expire_date:flags.1?int usage_limit:flags.2?int usage:flags.3?int = ExportedChatInvite;
chatInviteExported#ab4a819 flags:# revoked:flags.0?true permanent:flags.5?true request_needed:flags.6?true link:string admin_id:long date:int start_date:flags.4?int expire_date:flags.1?int usage_limit:flags.2?int usage:flags.3?int requested:flags.7?int title:flags.8?string = ExportedChatInvite;
chatInviteAlready#5a686d7c chat:Chat = ChatInvite;
chatInvite#dfc2f58e flags:# channel:flags.0?true broadcast:flags.1?true public:flags.2?true megagroup:flags.3?true title:string photo:Photo participants_count:int participants:flags.4?Vector<User> = ChatInvite;
chatInvite#300c44c1 flags:# channel:flags.0?true broadcast:flags.1?true public:flags.2?true megagroup:flags.3?true request_needed:flags.6?true title:string about:flags.5?string photo:Photo participants_count:int participants:flags.4?Vector<User> = ChatInvite;
chatInvitePeek#61695cb0 chat:Chat expires:int = ChatInvite;
inputStickerSetEmpty#ffb62b95 = InputStickerSet;
@ -615,7 +618,7 @@ channelMessagesFilterEmpty#94d42ee7 = ChannelMessagesFilter;
channelMessagesFilter#cd77d957 flags:# exclude_new_messages:flags.1?true ranges:Vector<MessageRange> = ChannelMessagesFilter;
channelParticipant#c00c07c0 user_id:long date:int = ChannelParticipant;
channelParticipantSelf#28a8bc67 user_id:long inviter_id:long date:int = ChannelParticipant;
channelParticipantSelf#35a8bfa7 flags:# via_invite:flags.0?true user_id:long inviter_id:long date:int = ChannelParticipant;
channelParticipantCreator#2fe601d3 flags:# user_id:long admin_rights:ChatAdminRights rank:flags.0?string = ChannelParticipant;
channelParticipantAdmin#34c3bb53 flags:# can_edit:flags.0?true self:flags.1?true user_id:long inviter_id:flags.1?long promoted_by:long date:int admin_rights:ChatAdminRights rank:flags.2?string = ChannelParticipant;
channelParticipantBanned#6df8014e flags:# left:flags.0?true peer:Peer kicked_by:long date:int banned_rights:ChatBannedRights = ChannelParticipant;
@ -898,6 +901,7 @@ channelAdminLogEventActionExportedInviteRevoke#410a134e invite:ExportedChatInvit
channelAdminLogEventActionExportedInviteEdit#e90ebb59 prev_invite:ExportedChatInvite new_invite:ExportedChatInvite = ChannelAdminLogEventAction;
channelAdminLogEventActionParticipantVolume#3e7f6847 participant:GroupCallParticipant = ChannelAdminLogEventAction;
channelAdminLogEventActionChangeHistoryTTL#6e941a38 prev_value:int new_value:int = ChannelAdminLogEventAction;
channelAdminLogEventActionParticipantJoinByRequest#afb6144a invite:ExportedChatInvite approved_by:long = ChannelAdminLogEventAction;
channelAdminLogEvent#1fad68cd id:long date:int user_id:long action:ChannelAdminLogEventAction = ChannelAdminLogEvent;
@ -1112,7 +1116,7 @@ restrictionReason#d072acb4 platform:string reason:string text:string = Restricti
inputTheme#3c5693e9 id:long access_hash:long = InputTheme;
inputThemeSlug#f5890df1 slug:string = InputTheme;
theme#e802b8dc flags:# creator:flags.0?true default:flags.1?true for_chat:flags.5?true id:long access_hash:long slug:string title:string document:flags.2?Document settings:flags.3?ThemeSettings installs_count:flags.4?int = Theme;
theme#a00e67d6 flags:# creator:flags.0?true default:flags.1?true for_chat:flags.5?true id:long access_hash:long slug:string title:string document:flags.2?Document settings:flags.3?Vector<ThemeSettings> emoticon:flags.6?string installs_count:flags.4?int = Theme;
account.themesNotModified#f41eb622 = account.Themes;
account.themes#9a3d8c6d hash:long themes:Vector<Theme> = account.Themes;
@ -1224,7 +1228,7 @@ messages.historyImportParsed#5e0fb7b9 flags:# pm:flags.0?true group:flags.1?true
messages.affectedFoundMessages#ef8d3e6c pts:int pts_count:int offset:int messages:Vector<int> = messages.AffectedFoundMessages;
chatInviteImporter#b5cd5f4 user_id:long date:int = ChatInviteImporter;
chatInviteImporter#8c5adfd9 flags:# requested:flags.0?true user_id:long date:int about:flags.2?string approved_by:flags.1?long = ChatInviteImporter;
messages.exportedChatInvites#bdc62dcc count:int invites:Vector<ExportedChatInvite> users:Vector<User> = messages.ExportedChatInvites;
@ -1261,15 +1265,18 @@ account.resetPasswordFailedWait#e3779861 retry_date:int = account.ResetPasswordR
account.resetPasswordRequestedWait#e9effc7d until_date:int = account.ResetPasswordResult;
account.resetPasswordOk#e926d63e = account.ResetPasswordResult;
chatTheme#ed0b5c33 emoticon:string theme:Theme dark_theme:Theme = ChatTheme;
account.chatThemesNotModified#e011e1c4 = account.ChatThemes;
account.chatThemes#fe4cbebd hash:int themes:Vector<ChatTheme> = account.ChatThemes;
sponsoredMessage#2a3c381f flags:# random_id:bytes from_id:Peer start_param:flags.0?string message:string entities:flags.1?Vector<MessageEntity> = SponsoredMessage;
sponsoredMessage#d151e19a flags:# random_id:bytes from_id:Peer channel_post:flags.2?int start_param:flags.0?string message:string entities:flags.1?Vector<MessageEntity> = SponsoredMessage;
messages.sponsoredMessages#65a4c7d5 messages:Vector<SponsoredMessage> chats:Vector<Chat> users:Vector<User> = messages.SponsoredMessages;
searchResultsCalendarPeriod#c9b0539f date:int min_msg_id:int max_msg_id:int count:int = SearchResultsCalendarPeriod;
messages.searchResultsCalendar#147ee23c flags:# inexact:flags.0?true count:int min_date:int min_msg_id:int offset_id_offset:flags.1?int periods:Vector<SearchResultsCalendarPeriod> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.SearchResultsCalendar;
searchResultPosition#7f648b67 msg_id:int date:int offset:int = SearchResultsPosition;
messages.searchResultsPositions#53b22baf count:int positions:Vector<SearchResultsPosition> = messages.SearchResultsPositions;
---functions---
invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X;
@ -1356,10 +1363,10 @@ account.resetWallPapers#bb3b9804 = Bool;
account.getAutoDownloadSettings#56da0b3f = account.AutoDownloadSettings;
account.saveAutoDownloadSettings#76f36233 flags:# low:flags.0?true high:flags.1?true settings:AutoDownloadSettings = Bool;
account.uploadTheme#1c3db333 flags:# file:InputFile thumb:flags.0?InputFile file_name:string mime_type:string = Document;
account.createTheme#8432c21f flags:# slug:string title:string document:flags.2?InputDocument settings:flags.3?InputThemeSettings = Theme;
account.updateTheme#5cb367d5 flags:# format:string theme:InputTheme slug:flags.0?string title:flags.1?string document:flags.2?InputDocument settings:flags.3?InputThemeSettings = Theme;
account.createTheme#652e4400 flags:# slug:string title:string document:flags.2?InputDocument settings:flags.3?Vector<InputThemeSettings> = Theme;
account.updateTheme#2bf40ccc flags:# format:string theme:InputTheme slug:flags.0?string title:flags.1?string document:flags.2?InputDocument settings:flags.3?Vector<InputThemeSettings> = Theme;
account.saveTheme#f257106c theme:InputTheme unsave:Bool = Bool;
account.installTheme#7ae43737 flags:# dark:flags.0?true format:flags.1?string theme:flags.1?InputTheme = Bool;
account.installTheme#c727bb3b flags:# dark:flags.0?true theme:flags.1?InputTheme format:flags.2?string base_theme:flags.3?BaseTheme = Bool;
account.getTheme#8d9d742b format:string theme:InputTheme document_id:long = Theme;
account.getThemes#7206e458 format:string hash:long = account.Themes;
account.setContentSettings#b574b16b flags:# sensitive_enabled:flags.0?true = Bool;
@ -1370,7 +1377,7 @@ account.setGlobalPrivacySettings#1edaaac2 settings:GlobalPrivacySettings = Globa
account.reportProfilePhoto#fa8cc6f5 peer:InputPeer photo_id:InputPhoto reason:ReportReason message:string = Bool;
account.resetPassword#9308ce1b = account.ResetPasswordResult;
account.declinePasswordReset#4c9409f6 = Bool;
account.getChatThemes#d6d71d7b hash:int = account.ChatThemes;
account.getChatThemes#d638de89 hash:long = account.Themes;
users.getUsers#d91a548 id:Vector<InputUser> = Vector<User>;
users.getFullUser#ca30a5b1 id:InputUser = UserFull;
@ -1402,7 +1409,7 @@ messages.getDialogs#a0f4cb4f flags:# exclude_pinned:flags.0?true folder_id:flags
messages.getHistory#4423e6c5 peer:InputPeer offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages;
messages.search#a0fda762 flags:# peer:InputPeer q:string from_id:flags.0?InputPeer top_msg_id:flags.1?int filter:MessagesFilter min_date:int max_date:int offset_id:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages;
messages.readHistory#e306d3a peer:InputPeer max_id:int = messages.AffectedMessages;
messages.deleteHistory#1c015b09 flags:# just_clear:flags.0?true revoke:flags.1?true peer:InputPeer max_id:int = messages.AffectedHistory;
messages.deleteHistory#b08f922a flags:# just_clear:flags.0?true revoke:flags.1?true peer:InputPeer max_id:int min_date:flags.2?int max_date:flags.3?int = messages.AffectedHistory;
messages.deleteMessages#e58e95d2 flags:# revoke:flags.0?true id:Vector<int> = messages.AffectedMessages;
messages.receivedMessages#5a954c0 max_id:int = Vector<ReceivedNotifyMessage>;
messages.setTyping#58943ee2 flags:# peer:InputPeer top_msg_id:flags.0?int action:SendMessageAction = Bool;
@ -1434,7 +1441,7 @@ messages.readMessageContents#36a73f77 id:Vector<int> = messages.AffectedMessages
messages.getStickers#d5a5d3a1 emoticon:string hash:long = messages.Stickers;
messages.getAllStickers#b8a0a1a8 hash:long = messages.AllStickers;
messages.getWebPagePreview#8b68b0cc flags:# message:string entities:flags.3?Vector<MessageEntity> = MessageMedia;
messages.exportChatInvite#14b9bcd7 flags:# legacy_revoke_permanent:flags.2?true peer:InputPeer expire_date:flags.0?int usage_limit:flags.1?int = ExportedChatInvite;
messages.exportChatInvite#a02ce5d5 flags:# legacy_revoke_permanent:flags.2?true request_needed:flags.3?true peer:InputPeer expire_date:flags.0?int usage_limit:flags.1?int title:flags.4?string = ExportedChatInvite;
messages.checkChatInvite#3eadb1bb hash:string = ChatInvite;
messages.importChatInvite#6c50051c hash:string = Updates;
messages.getStickerSet#2619a90e stickerset:InputStickerSet = messages.StickerSet;
@ -1531,15 +1538,18 @@ messages.uploadImportedMedia#2a862092 peer:InputPeer import_id:long file_name:st
messages.startHistoryImport#b43df344 peer:InputPeer import_id:long = Bool;
messages.getExportedChatInvites#a2b5a3f6 flags:# revoked:flags.3?true peer:InputPeer admin_id:InputUser offset_date:flags.2?int offset_link:flags.2?string limit:int = messages.ExportedChatInvites;
messages.getExportedChatInvite#73746f5c peer:InputPeer link:string = messages.ExportedChatInvite;
messages.editExportedChatInvite#2e4ffbe flags:# revoked:flags.2?true peer:InputPeer link:string expire_date:flags.0?int usage_limit:flags.1?int = messages.ExportedChatInvite;
messages.editExportedChatInvite#bdca2f75 flags:# revoked:flags.2?true peer:InputPeer link:string expire_date:flags.0?int usage_limit:flags.1?int request_needed:flags.3?Bool title:flags.4?string = messages.ExportedChatInvite;
messages.deleteRevokedExportedChatInvites#56987bd5 peer:InputPeer admin_id:InputUser = Bool;
messages.deleteExportedChatInvite#d464a42b peer:InputPeer link:string = Bool;
messages.getAdminsWithInvites#3920e6ef peer:InputPeer = messages.ChatAdminsWithInvites;
messages.getChatInviteImporters#26fb7289 peer:InputPeer link:string offset_date:int offset_user:InputUser limit:int = messages.ChatInviteImporters;
messages.getChatInviteImporters#df04dd4e flags:# requested:flags.0?true peer:InputPeer link:flags.1?string q:flags.2?string offset_date:int offset_user:InputUser limit:int = messages.ChatInviteImporters;
messages.setHistoryTTL#b80e5fe4 peer:InputPeer period:int = Updates;
messages.checkHistoryImportPeer#5dc60f03 peer:InputPeer = messages.CheckedHistoryImportPeer;
messages.setChatTheme#e63be13f peer:InputPeer emoticon:string = Updates;
messages.getMessageReadParticipants#2c6f97b7 peer:InputPeer msg_id:int = Vector<long>;
messages.getSearchResultsCalendar#49f0bde9 peer:InputPeer filter:MessagesFilter offset_id:int offset_date:int = messages.SearchResultsCalendar;
messages.getSearchResultsPositions#6e9583a3 peer:InputPeer filter:MessagesFilter offset_id:int limit:int = messages.SearchResultsPositions;
messages.hideChatJoinRequest#7fe7e815 flags:# approved:flags.0?true peer:InputPeer user_id:InputUser = Updates;
updates.getState#edd4882a = updates.State;
updates.getDifference#25939651 flags:# pts:int pts_total_limit:flags.0?int date:int qts:int = updates.Difference;

View File

@ -1629,7 +1629,7 @@ class ExportChatInviteQuery final : public Td::ResultHandler {
}
send_query(G()->net_query_creator().create(telegram_api::messages_exportChatInvite(
flags, false /*ignored*/, std::move(input_peer), expire_date, usage_limit)));
flags, false /*ignored*/, false /*ignored*/, std::move(input_peer), expire_date, usage_limit, string())));
}
void on_result(uint64 id, BufferSlice packet) final {
@ -1679,7 +1679,7 @@ class EditChatInviteLinkQuery final : public Td::ResultHandler {
int32 flags = telegram_api::messages_editExportedChatInvite::EXPIRE_DATE_MASK |
telegram_api::messages_editExportedChatInvite::USAGE_LIMIT_MASK;
send_query(G()->net_query_creator().create(telegram_api::messages_editExportedChatInvite(
flags, false /*ignored*/, std::move(input_peer), invite_link, expire_date, usage_limit)));
flags, false /*ignored*/, std::move(input_peer), invite_link, expire_date, usage_limit, false, string())));
}
void on_result(uint64 id, BufferSlice packet) final {
@ -1901,8 +1901,10 @@ class GetChatInviteImportersQuery final : public Td::ResultHandler {
input_user = make_tl_object<telegram_api::inputUserEmpty>();
}
send_query(G()->net_query_creator().create(telegram_api::messages_getChatInviteImporters(
std::move(input_peer), invite_link, offset_date, std::move(input_user), limit)));
int32 flags = telegram_api::messages_getChatInviteImporters::LINK_MASK;
send_query(G()->net_query_creator().create(
telegram_api::messages_getChatInviteImporters(flags, false /*ignored*/, std::move(input_peer), invite_link,
string(), offset_date, std::move(input_user), limit)));
}
void on_result(uint64 id, BufferSlice packet) final {
@ -1959,7 +1961,7 @@ class RevokeChatInviteLinkQuery final : public Td::ResultHandler {
int32 flags = telegram_api::messages_editExportedChatInvite::REVOKED_MASK;
send_query(G()->net_query_creator().create(telegram_api::messages_editExportedChatInvite(
flags, false /*ignored*/, std::move(input_peer), invite_link, 0, 0)));
flags, false /*ignored*/, std::move(input_peer), invite_link, 0, 0, false, string())));
}
void on_result(uint64 id, BufferSlice packet) final {

View File

@ -4733,6 +4733,8 @@ unique_ptr<MessageContent> get_action_message_content(Td *td, tl_object_ptr<tele
auto set_chat_theme = move_tl_object_as<telegram_api::messageActionSetChatTheme>(action);
return td::make_unique<MessageChatSetTheme>(std::move(set_chat_theme->emoticon_));
}
case telegram_api::messageActionChatJoinedByRequest::ID:
return make_unique<MessageChatJoinedByLink>();
default:
UNREACHABLE();
}

View File

@ -2589,7 +2589,7 @@ class DeleteHistoryQuery final : public Td::ResultHandler {
send_query(G()->net_query_creator().create(
telegram_api::messages_deleteHistory(flags, false /*ignored*/, false /*ignored*/, std::move(input_peer),
max_message_id_.get_server_message_id().get())));
max_message_id_.get_server_message_id().get(), 0, 0)));
}
public:
@ -31689,6 +31689,8 @@ tl_object_ptr<td_api::ChatEventAction> MessagesManager::get_chat_event_action_ob
return make_tl_object<td_api::chatEventMemberJoinedByInviteLink>(
invite_link.get_chat_invite_link_object(td_->contacts_manager_.get()));
}
case telegram_api::channelAdminLogEventActionParticipantJoinByRequest::ID:
return nullptr;
case telegram_api::channelAdminLogEventActionParticipantLeave::ID:
return make_tl_object<td_api::chatEventMemberLeft>();
case telegram_api::channelAdminLogEventActionParticipantInvite::ID: {

View File

@ -16,6 +16,7 @@
#include "td/utils/algorithm.h"
#include "td/utils/buffer.h"
#include "td/utils/emoji.h"
#include "td/utils/logging.h"
#include "td/utils/Random.h"
#include "td/utils/Time.h"
@ -24,14 +25,14 @@
namespace td {
class GetChatThemesQuery final : public Td::ResultHandler {
Promise<telegram_api::object_ptr<telegram_api::account_ChatThemes>> promise_;
Promise<telegram_api::object_ptr<telegram_api::account_Themes>> promise_;
public:
explicit GetChatThemesQuery(Promise<telegram_api::object_ptr<telegram_api::account_ChatThemes>> &&promise)
explicit GetChatThemesQuery(Promise<telegram_api::object_ptr<telegram_api::account_Themes>> &&promise)
: promise_(std::move(promise)) {
}
void send(int32 hash) {
void send(int64 hash) {
send_query(G()->net_query_creator().create(telegram_api::account_getChatThemes(hash)));
}
@ -111,8 +112,7 @@ void ThemeManager::ChatTheme::store(StorerT &storer) const {
BEGIN_STORE_FLAGS();
END_STORE_FLAGS();
td::store(emoji, storer);
td::store(light_id, storer);
td::store(dark_id, storer);
td::store(id, storer);
td::store(light_theme, storer);
td::store(dark_theme, storer);
}
@ -122,8 +122,7 @@ void ThemeManager::ChatTheme::parse(ParserT &parser) {
BEGIN_PARSE_FLAGS();
END_PARSE_FLAGS();
td::parse(emoji, parser);
td::parse(light_id, parser);
td::parse(dark_id, parser);
td::parse(id, parser);
td::parse(light_theme, parser);
td::parse(dark_theme, parser);
}
@ -180,29 +179,57 @@ void ThemeManager::loop() {
}
auto request_promise = PromiseCreator::lambda(
[actor_id = actor_id(this)](Result<telegram_api::object_ptr<telegram_api::account_ChatThemes>> result) {
[actor_id = actor_id(this)](Result<telegram_api::object_ptr<telegram_api::account_Themes>> result) {
send_closure(actor_id, &ThemeManager::on_get_chat_themes, std::move(result));
});
td_->create_handler<GetChatThemesQuery>(std::move(request_promise))->send(chat_themes_.hash);
}
bool ThemeManager::is_dark_base_theme(BaseTheme base_theme) {
switch (base_theme) {
case BaseTheme::Classic:
case BaseTheme::Day:
case BaseTheme::Arctic:
return false;
case BaseTheme::Night:
case BaseTheme::Tinted:
return true;
default:
UNREACHABLE();
return false;
}
}
void ThemeManager::on_update_theme(telegram_api::object_ptr<telegram_api::theme> &&theme, Promise<Unit> &&promise) {
CHECK(theme != nullptr);
bool is_changed = false;
bool was_light = false;
bool was_dark = false;
for (auto &chat_theme : chat_themes_.themes) {
if (chat_theme.light_id == theme->id_ || chat_theme.dark_id == theme->id_) {
auto theme_settings = get_chat_theme_settings(std::move(theme->settings_));
if (theme_settings.message_colors.empty()) {
break;
}
if (chat_theme.light_id == theme->id_ && chat_theme.light_theme != theme_settings) {
chat_theme.light_theme = theme_settings;
is_changed = true;
}
if (chat_theme.dark_id == theme->id_ && chat_theme.dark_theme != theme_settings) {
chat_theme.dark_theme = theme_settings;
is_changed = true;
if (chat_theme.id == theme->id_) {
for (auto &settings : theme->settings_) {
auto theme_settings = get_chat_theme_settings(std::move(settings));
if (theme_settings.message_colors.empty()) {
continue;
}
if (is_dark_base_theme(theme_settings.base_theme)) {
if (!was_dark) {
was_dark = true;
if (chat_theme.dark_theme != theme_settings) {
chat_theme.dark_theme = std::move(theme_settings);
is_changed = true;
}
}
} else {
if (!was_light) {
was_light = true;
if (chat_theme.light_theme != theme_settings) {
chat_theme.light_theme = std::move(theme_settings);
is_changed = true;
}
}
}
}
}
}
@ -254,7 +281,7 @@ void ThemeManager::send_update_chat_themes() const {
send_closure(G()->td(), &Td::send_update, get_update_chat_themes_object());
}
void ThemeManager::on_get_chat_themes(Result<telegram_api::object_ptr<telegram_api::account_ChatThemes>> result) {
void ThemeManager::on_get_chat_themes(Result<telegram_api::object_ptr<telegram_api::account_Themes>> result) {
if (result.is_error()) {
set_timeout_in(Random::fast(40, 60));
return;
@ -265,29 +292,49 @@ void ThemeManager::on_get_chat_themes(Result<telegram_api::object_ptr<telegram_a
auto chat_themes_ptr = result.move_as_ok();
LOG(DEBUG) << "Receive " << to_string(chat_themes_ptr);
if (chat_themes_ptr->get_id() == telegram_api::account_chatThemesNotModified::ID) {
if (chat_themes_ptr->get_id() == telegram_api::account_themesNotModified::ID) {
return;
}
CHECK(chat_themes_ptr->get_id() == telegram_api::account_chatThemes::ID);
auto chat_themes = telegram_api::move_object_as<telegram_api::account_chatThemes>(chat_themes_ptr);
CHECK(chat_themes_ptr->get_id() == telegram_api::account_themes::ID);
auto chat_themes = telegram_api::move_object_as<telegram_api::account_themes>(chat_themes_ptr);
chat_themes_.hash = chat_themes->hash_;
chat_themes_.themes.clear();
for (auto &chat_theme : chat_themes->themes_) {
if (chat_theme->emoticon_.empty()) {
LOG(ERROR) << "Receive " << to_string(chat_theme);
for (auto &theme : chat_themes->themes_) {
if (!is_emoji(theme->emoticon_) || !theme->for_chat_) {
LOG(ERROR) << "Receive " << to_string(theme);
continue;
}
ChatTheme theme;
theme.emoji = std::move(chat_theme->emoticon_);
theme.light_id = chat_theme->theme_->id_;
theme.dark_id = chat_theme->dark_theme_->id_;
theme.light_theme = get_chat_theme_settings(std::move(chat_theme->theme_->settings_));
theme.dark_theme = get_chat_theme_settings(std::move(chat_theme->dark_theme_->settings_));
if (theme.light_theme.message_colors.empty() || theme.dark_theme.message_colors.empty()) {
bool was_light = false;
bool was_dark = false;
ChatTheme chat_theme;
chat_theme.emoji = std::move(theme->emoticon_);
chat_theme.id = theme->id_;
for (auto &settings : theme->settings_) {
auto theme_settings = get_chat_theme_settings(std::move(settings));
if (theme_settings.message_colors.empty()) {
continue;
}
if (is_dark_base_theme(theme_settings.base_theme)) {
if (!was_dark) {
was_dark = true;
if (chat_theme.dark_theme != theme_settings) {
chat_theme.dark_theme = std::move(theme_settings);
}
}
} else {
if (!was_light) {
was_light = true;
if (chat_theme.light_theme != theme_settings) {
chat_theme.light_theme = std::move(theme_settings);
}
}
}
}
if (chat_theme.light_theme.message_colors.empty() || chat_theme.dark_theme.message_colors.empty()) {
continue;
}
chat_themes_.themes.push_back(std::move(theme));
chat_themes_.themes.push_back(std::move(chat_theme));
}
save_chat_themes();

View File

@ -59,8 +59,7 @@ class ThemeManager final : public Actor {
struct ChatTheme {
string emoji;
int64 light_id = 0;
int64 dark_id = 0;
int64 id = 0;
ThemeSettings light_theme;
ThemeSettings dark_theme;
@ -72,7 +71,7 @@ class ThemeManager final : public Actor {
};
struct ChatThemes {
int32 hash = 0;
int64 hash = 0;
double next_reload_time = 0;
vector<ChatTheme> themes;
@ -89,7 +88,9 @@ class ThemeManager final : public Actor {
void tear_down() final;
void on_get_chat_themes(Result<telegram_api::object_ptr<telegram_api::account_ChatThemes>> result);
static bool is_dark_base_theme(BaseTheme base_theme);
void on_get_chat_themes(Result<telegram_api::object_ptr<telegram_api::account_Themes>> result);
td_api::object_ptr<td_api::themeSettings> get_theme_settings_object(const ThemeSettings &settings) const;

View File

@ -676,6 +676,7 @@ bool UpdatesManager::is_acceptable_message(const telegram_api::Message *message_
case telegram_api::messageActionGroupCallScheduled::ID:
case telegram_api::messageActionSetMessagesTTL::ID:
case telegram_api::messageActionSetChatTheme::ID:
case telegram_api::messageActionChatJoinedByRequest::ID:
break;
case telegram_api::messageActionChatCreate::ID: {
auto chat_create = static_cast<const telegram_api::messageActionChatCreate *>(action);
@ -695,13 +696,9 @@ bool UpdatesManager::is_acceptable_message(const telegram_api::Message *message_
}
break;
}
case telegram_api::messageActionChatJoinedByLink::ID: {
auto chat_joined_by_link = static_cast<const telegram_api::messageActionChatJoinedByLink *>(action);
if (!is_acceptable_user(UserId(chat_joined_by_link->inviter_id_))) {
return false;
}
case telegram_api::messageActionChatJoinedByLink::ID:
// inviter_id_ isn't used
break;
}
case telegram_api::messageActionChatDeleteUser::ID: {
auto chat_delete_user = static_cast<const telegram_api::messageActionChatDeleteUser *>(action);
if (!is_acceptable_user(UserId(chat_delete_user->user_id_))) {
@ -3217,4 +3214,11 @@ void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateTheme> update,
// unsupported updates
void UpdatesManager::on_update(tl_object_ptr<telegram_api::updatePendingJoinRequests> update, Promise<Unit> &&promise) {
}
void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateBotChatInviteRequester> update,
Promise<Unit> &&promise) {
}
} // namespace td

View File

@ -491,6 +491,10 @@ class UpdatesManager final : public Actor {
void on_update(tl_object_ptr<telegram_api::updateTheme> update, Promise<Unit> &&promise);
// unsupported updates
void on_update(tl_object_ptr<telegram_api::updatePendingJoinRequests> update, Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateBotChatInviteRequester> update, Promise<Unit> &&promise);
};
} // namespace td

View File

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