Update API scheme on layer 158.
This commit is contained in:
parent
6be2fb9790
commit
312aa4b130
|
@ -1523,6 +1523,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
"lng_action_attach_menu_bot_allowed" = "You allowed this bot to message you when you added it in the attachment menu.";
|
"lng_action_attach_menu_bot_allowed" = "You allowed this bot to message you when you added it in the attachment menu.";
|
||||||
"lng_action_set_wallpaper_me" = "You set a new background for this chat.";
|
"lng_action_set_wallpaper_me" = "You set a new background for this chat.";
|
||||||
"lng_action_set_wallpaper" = "{user} set a new background for this chat.";
|
"lng_action_set_wallpaper" = "{user} set a new background for this chat.";
|
||||||
|
"lng_action_set_same_wallpaper_me" = "You set {background} for this chat.";
|
||||||
|
"lng_action_set_same_wallpaper" = "{user} set {background} for this chat.";
|
||||||
|
"lng_action_set_same_background" = "the same background";
|
||||||
"lng_action_topic_created_inside" = "Topic created";
|
"lng_action_topic_created_inside" = "Topic created";
|
||||||
"lng_action_topic_closed_inside" = "Topic closed";
|
"lng_action_topic_closed_inside" = "Topic closed";
|
||||||
"lng_action_topic_reopened_inside" = "Topic reopened";
|
"lng_action_topic_reopened_inside" = "Topic reopened";
|
||||||
|
@ -3577,8 +3580,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
"lng_filters_link_private_status" = "you can't share private chats";
|
"lng_filters_link_private_status" = "you can't share private chats";
|
||||||
"lng_filters_link_private_error" = "Private chats can't be shared.";
|
"lng_filters_link_private_error" = "Private chats can't be shared.";
|
||||||
"lng_filters_link_noadmin_status" = "you can't invite others here";
|
"lng_filters_link_noadmin_status" = "you can't invite others here";
|
||||||
"lng_filters_link_noadmin_group_error" = "You don't have the admin rights to share invite links to this group chat.";
|
"lng_filters_link_noadmin_group_error" = "You don't have the admin rights to share invite links to this private group chat.";
|
||||||
"lng_filters_link_noadmin_channel_error" = "You don't have the admin rights to share invite links to this channel.";
|
"lng_filters_link_noadmin_channel_error" = "You don't have the admin rights to share invite links to this private channel.";
|
||||||
"lng_filters_link_already_group" = "you are already a member";
|
"lng_filters_link_already_group" = "you are already a member";
|
||||||
"lng_filters_link_already_channel" = "you are already subscribed";
|
"lng_filters_link_already_channel" = "you are already subscribed";
|
||||||
"lng_filters_link_chats_about" = "Select groups and channels that you want everyone who adds the folder via invite link to join.";
|
"lng_filters_link_chats_about" = "Select groups and channels that you want everyone who adds the folder via invite link to join.";
|
||||||
|
@ -3587,6 +3590,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
"lng_filters_link_chats_no_about" = "You can only share groups and channels in which you are allowed to create invite links.";
|
"lng_filters_link_chats_no_about" = "You can only share groups and channels in which you are allowed to create invite links.";
|
||||||
"lng_filters_link_name_it" = "Name Link";
|
"lng_filters_link_name_it" = "Name Link";
|
||||||
"lng_filters_link_delete_sure" = "Are you sure you want to delete this link?";
|
"lng_filters_link_delete_sure" = "Are you sure you want to delete this link?";
|
||||||
|
"lng_filters_link_qr_about" = "Everyone on Telegram can scan this code to add this folder and join the chats included in this invite link.";
|
||||||
"lng_filters_by_link_title" = "Add Folder";
|
"lng_filters_by_link_title" = "Add Folder";
|
||||||
"lng_filters_by_link_sure" = "Do you want to add a new chat folder {folder} and join its groups and channels?";
|
"lng_filters_by_link_sure" = "Do you want to add a new chat folder {folder} and join its groups and channels?";
|
||||||
"lng_filters_by_link_join#one" = "{count} chat to join";
|
"lng_filters_by_link_join#one" = "{count} chat to join";
|
||||||
|
@ -3603,7 +3607,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
"lng_filters_by_link_in#one" = "{count} chat in this folder";
|
"lng_filters_by_link_in#one" = "{count} chat in this folder";
|
||||||
"lng_filters_by_link_in#other" = "{count} chats in this folder";
|
"lng_filters_by_link_in#other" = "{count} chats in this folder";
|
||||||
"lng_filters_by_link_remove" = "Remove Folder";
|
"lng_filters_by_link_remove" = "Remove Folder";
|
||||||
"lng_filters_by_link_remove_sure" = "Do you want to quit the chats you joined when added the folder {folder}?";
|
"lng_filters_by_link_remove_sure" = "Do you also want to quit the chats included in the folder {folder}?";
|
||||||
"lng_filters_by_link_quit#one" = "{count} chat to quit";
|
"lng_filters_by_link_quit#one" = "{count} chat to quit";
|
||||||
"lng_filters_by_link_quit#other" = "{count} chats to quit";
|
"lng_filters_by_link_quit#other" = "{count} chats to quit";
|
||||||
"lng_filters_by_link_select" = "Select All";
|
"lng_filters_by_link_select" = "Select All";
|
||||||
|
@ -3619,7 +3623,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
"lng_filters_updated_also#other" = "You have joined {count} new chats.";
|
"lng_filters_updated_also#other" = "You have joined {count} new chats.";
|
||||||
"lng_filters_bar_you_can#one" = "You can join {count} new chat";
|
"lng_filters_bar_you_can#one" = "You can join {count} new chat";
|
||||||
"lng_filters_bar_you_can#other" = "You can join {count} new chats";
|
"lng_filters_bar_you_can#other" = "You can join {count} new chats";
|
||||||
"lng_filters_bar_view" = "Click here to view them";
|
"lng_filters_bar_view#one" = "Click here to view it";
|
||||||
|
"lng_filters_bar_view#other" = "Click here to view them";
|
||||||
|
|
||||||
"lng_chat_theme_change" = "Change colors";
|
"lng_chat_theme_change" = "Change colors";
|
||||||
"lng_chat_theme_none" = "No\nTheme";
|
"lng_chat_theme_none" = "No\nTheme";
|
||||||
|
|
|
@ -197,6 +197,7 @@ messageActionTopicEdit#c0944820 flags:# title:flags.0?string icon_emoji_id:flags
|
||||||
messageActionSuggestProfilePhoto#57de635e photo:Photo = MessageAction;
|
messageActionSuggestProfilePhoto#57de635e photo:Photo = MessageAction;
|
||||||
messageActionRequestedPeer#fe77345d button_id:int peer:Peer = MessageAction;
|
messageActionRequestedPeer#fe77345d button_id:int peer:Peer = MessageAction;
|
||||||
messageActionSetChatWallPaper#bc44a927 wallpaper:WallPaper = MessageAction;
|
messageActionSetChatWallPaper#bc44a927 wallpaper:WallPaper = MessageAction;
|
||||||
|
messageActionSetSameChatWallPaper#da54583a = MessageAction;
|
||||||
|
|
||||||
dialog#d58a08c6 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 unread_reactions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage folder_id:flags.4?int ttl_period:flags.5?int = Dialog;
|
dialog#d58a08c6 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 unread_reactions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage folder_id:flags.4?int ttl_period:flags.5?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;
|
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;
|
||||||
|
@ -386,7 +387,7 @@ updateGroupCallParticipants#f2ebdb4e call:InputGroupCall participants:Vector<Gro
|
||||||
updateGroupCall#14b24500 chat_id:long call:GroupCall = Update;
|
updateGroupCall#14b24500 chat_id:long call:GroupCall = Update;
|
||||||
updatePeerHistoryTTL#bb9bb9a5 flags:# peer:Peer ttl_period:flags.0?int = Update;
|
updatePeerHistoryTTL#bb9bb9a5 flags:# peer:Peer ttl_period:flags.0?int = Update;
|
||||||
updateChatParticipant#d087663a flags:# chat_id:long date:int actor_id:long user_id:long prev_participant:flags.0?ChatParticipant new_participant:flags.1?ChatParticipant invite:flags.2?ExportedChatInvite qts:int = Update;
|
updateChatParticipant#d087663a flags:# chat_id:long date:int actor_id:long user_id:long prev_participant:flags.0?ChatParticipant new_participant:flags.1?ChatParticipant invite:flags.2?ExportedChatInvite qts:int = Update;
|
||||||
updateChannelParticipant#985d3abb flags:# via_community:flags.3?true channel_id:long date:int actor_id:long user_id:long prev_participant:flags.0?ChannelParticipant new_participant:flags.1?ChannelParticipant invite:flags.2?ExportedChatInvite qts:int = Update;
|
updateChannelParticipant#985d3abb flags:# via_chatlist:flags.3?true channel_id:long date:int actor_id:long user_id:long prev_participant:flags.0?ChannelParticipant new_participant:flags.1?ChannelParticipant invite:flags.2?ExportedChatInvite qts:int = Update;
|
||||||
updateBotStopped#c4870a49 user_id:long date:int stopped:Bool qts:int = Update;
|
updateBotStopped#c4870a49 user_id:long date:int stopped:Bool qts:int = Update;
|
||||||
updateGroupCallConnection#b783982 flags:# presentation:flags.0?true params:DataJSON = Update;
|
updateGroupCallConnection#b783982 flags:# presentation:flags.0?true params:DataJSON = Update;
|
||||||
updateBotCommands#4d712f2e peer:Peer bot_id:long commands:Vector<BotCommand> = Update;
|
updateBotCommands#4d712f2e peer:Peer bot_id:long commands:Vector<BotCommand> = Update;
|
||||||
|
@ -960,7 +961,7 @@ channelAdminLogEventActionDiscardGroupCall#db9f9140 call:InputGroupCall = Channe
|
||||||
channelAdminLogEventActionParticipantMute#f92424d2 participant:GroupCallParticipant = ChannelAdminLogEventAction;
|
channelAdminLogEventActionParticipantMute#f92424d2 participant:GroupCallParticipant = ChannelAdminLogEventAction;
|
||||||
channelAdminLogEventActionParticipantUnmute#e64429c0 participant:GroupCallParticipant = ChannelAdminLogEventAction;
|
channelAdminLogEventActionParticipantUnmute#e64429c0 participant:GroupCallParticipant = ChannelAdminLogEventAction;
|
||||||
channelAdminLogEventActionToggleGroupCallSetting#56d6a247 join_muted:Bool = ChannelAdminLogEventAction;
|
channelAdminLogEventActionToggleGroupCallSetting#56d6a247 join_muted:Bool = ChannelAdminLogEventAction;
|
||||||
channelAdminLogEventActionParticipantJoinByInvite#fe9fc158 flags:# via_community:flags.0?true invite:ExportedChatInvite = ChannelAdminLogEventAction;
|
channelAdminLogEventActionParticipantJoinByInvite#fe9fc158 flags:# via_chatlist:flags.0?true invite:ExportedChatInvite = ChannelAdminLogEventAction;
|
||||||
channelAdminLogEventActionExportedInviteDelete#5a50fca4 invite:ExportedChatInvite = ChannelAdminLogEventAction;
|
channelAdminLogEventActionExportedInviteDelete#5a50fca4 invite:ExportedChatInvite = ChannelAdminLogEventAction;
|
||||||
channelAdminLogEventActionExportedInviteRevoke#410a134e invite:ExportedChatInvite = ChannelAdminLogEventAction;
|
channelAdminLogEventActionExportedInviteRevoke#410a134e invite:ExportedChatInvite = ChannelAdminLogEventAction;
|
||||||
channelAdminLogEventActionExportedInviteEdit#e90ebb59 prev_invite:ExportedChatInvite new_invite:ExportedChatInvite = ChannelAdminLogEventAction;
|
channelAdminLogEventActionExportedInviteEdit#e90ebb59 prev_invite:ExportedChatInvite new_invite:ExportedChatInvite = ChannelAdminLogEventAction;
|
||||||
|
@ -1228,7 +1229,7 @@ payments.bankCardData#3e24e573 title:string open_urls:Vector<BankCardOpenUrl> =
|
||||||
|
|
||||||
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;
|
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;
|
||||||
dialogFilterDefault#363293ae = DialogFilter;
|
dialogFilterDefault#363293ae = DialogFilter;
|
||||||
dialogFilterCommunity#d8565037 flags:# id:int title:string emoticon:flags.25?string pinned_peers:Vector<InputPeer> include_peers:Vector<InputPeer> = DialogFilter;
|
dialogFilterChatlist#d64a04a8 flags:# has_my_invites:flags.26?true id:int title:string emoticon:flags.25?string pinned_peers:Vector<InputPeer> include_peers:Vector<InputPeer> = DialogFilter;
|
||||||
|
|
||||||
dialogFilterSuggested#77744d4a filter:DialogFilter description:string = DialogFilterSuggested;
|
dialogFilterSuggested#77744d4a filter:DialogFilter description:string = DialogFilterSuggested;
|
||||||
|
|
||||||
|
@ -1307,7 +1308,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;
|
messages.affectedFoundMessages#ef8d3e6c pts:int pts_count:int offset:int messages:Vector<int> = messages.AffectedFoundMessages;
|
||||||
|
|
||||||
chatInviteImporter#8c5adfd9 flags:# requested:flags.0?true via_community:flags.3?true user_id:long date:int about:flags.2?string approved_by:flags.1?long = ChatInviteImporter;
|
chatInviteImporter#8c5adfd9 flags:# requested:flags.0?true via_chatlist:flags.3?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;
|
messages.exportedChatInvites#bdc62dcc count:int invites:Vector<ExportedChatInvite> users:Vector<User> = messages.ExportedChatInvites;
|
||||||
|
|
||||||
|
@ -1526,18 +1527,18 @@ inlineBotWebView#b57295d5 text:string url:string = InlineBotWebView;
|
||||||
|
|
||||||
readParticipantDate#4a4ff172 user_id:long date:int = ReadParticipantDate;
|
readParticipantDate#4a4ff172 user_id:long date:int = ReadParticipantDate;
|
||||||
|
|
||||||
inputCommunityDialogFilter#1ae107a1 filter_id:int = InputCommunity;
|
inputChatlistDialogFilter#f3e0da33 filter_id:int = InputChatlist;
|
||||||
|
|
||||||
exportedCommunityInvite#ebddc1aa flags:# title:string url:string peers:Vector<Peer> = ExportedCommunityInvite;
|
exportedChatlistInvite#c5181ac flags:# title:string url:string peers:Vector<Peer> = ExportedChatlistInvite;
|
||||||
|
|
||||||
communities.exportedCommunityInvite#6b97a8ea filter:DialogFilter invite:ExportedCommunityInvite = communities.ExportedCommunityInvite;
|
chatlists.exportedChatlistInvite#10e6e3a6 filter:DialogFilter invite:ExportedChatlistInvite = chatlists.ExportedChatlistInvite;
|
||||||
|
|
||||||
communities.exportedInvites#ffd75fa7 invites:Vector<ExportedCommunityInvite> chats:Vector<Chat> users:Vector<User> = communities.ExportedInvites;
|
chatlists.exportedInvites#10ab6dc7 invites:Vector<ExportedChatlistInvite> chats:Vector<Chat> users:Vector<User> = chatlists.ExportedInvites;
|
||||||
|
|
||||||
communities.communityInviteAlready#c745ee07 filter_id:int missing_peers:Vector<Peer> already_peers:Vector<Peer> chats:Vector<Chat> users:Vector<User> = communities.CommunityInvite;
|
chatlists.chatlistInviteAlready#fa87f659 filter_id:int missing_peers:Vector<Peer> already_peers:Vector<Peer> chats:Vector<Chat> users:Vector<User> = chatlists.ChatlistInvite;
|
||||||
communities.communityInvite#3857da1 flags:# title:string emoticon:flags.0?string peers:Vector<Peer> chats:Vector<Chat> users:Vector<User> = communities.CommunityInvite;
|
chatlists.chatlistInvite#1dcd839d flags:# title:string emoticon:flags.0?string peers:Vector<Peer> chats:Vector<Chat> users:Vector<User> = chatlists.ChatlistInvite;
|
||||||
|
|
||||||
communities.communityUpdates#e74660b3 missing_peers:Vector<Peer> chats:Vector<Chat> users:Vector<User> = communities.CommunityUpdates;
|
chatlists.chatlistUpdates#93bd878d missing_peers:Vector<Peer> chats:Vector<Chat> users:Vector<User> = chatlists.ChatlistUpdates;
|
||||||
|
|
||||||
bots.botInfo#e8a775b0 name:string about:string description:string = bots.BotInfo;
|
bots.botInfo#e8a775b0 name:string about:string description:string = bots.BotInfo;
|
||||||
|
|
||||||
|
@ -1623,7 +1624,7 @@ account.getContactSignUpNotification#9f07c728 = Bool;
|
||||||
account.setContactSignUpNotification#cff43f61 silent:Bool = Bool;
|
account.setContactSignUpNotification#cff43f61 silent:Bool = Bool;
|
||||||
account.getNotifyExceptions#53577479 flags:# compare_sound:flags.1?true peer:flags.0?InputNotifyPeer = Updates;
|
account.getNotifyExceptions#53577479 flags:# compare_sound:flags.1?true peer:flags.0?InputNotifyPeer = Updates;
|
||||||
account.getWallPaper#fc8ddbea wallpaper:InputWallPaper = WallPaper;
|
account.getWallPaper#fc8ddbea wallpaper:InputWallPaper = WallPaper;
|
||||||
account.uploadWallPaper#dd853661 file:InputFile mime_type:string settings:WallPaperSettings = WallPaper;
|
account.uploadWallPaper#e39a8f03 flags:# for_chat:flags.0?true file:InputFile mime_type:string settings:WallPaperSettings = WallPaper;
|
||||||
account.saveWallPaper#6c5a5b37 wallpaper:InputWallPaper unsave:Bool settings:WallPaperSettings = Bool;
|
account.saveWallPaper#6c5a5b37 wallpaper:InputWallPaper unsave:Bool settings:WallPaperSettings = Bool;
|
||||||
account.installWallPaper#feed5769 wallpaper:InputWallPaper settings:WallPaperSettings = Bool;
|
account.installWallPaper#feed5769 wallpaper:InputWallPaper settings:WallPaperSettings = Bool;
|
||||||
account.resetWallPapers#bb3b9804 = Bool;
|
account.resetWallPapers#bb3b9804 = Bool;
|
||||||
|
@ -1877,7 +1878,7 @@ messages.searchCustomEmoji#2c11c0d7 emoticon:string hash:long = EmojiList;
|
||||||
messages.togglePeerTranslations#e47cb579 flags:# disabled:flags.0?true peer:InputPeer = Bool;
|
messages.togglePeerTranslations#e47cb579 flags:# disabled:flags.0?true peer:InputPeer = Bool;
|
||||||
messages.getBotApp#34fdc5c3 app:InputBotApp hash:long = messages.BotApp;
|
messages.getBotApp#34fdc5c3 app:InputBotApp hash:long = messages.BotApp;
|
||||||
messages.requestAppWebView#8c5a3b3c flags:# write_allowed:flags.0?true peer:InputPeer app:InputBotApp start_param:flags.1?string theme_params:flags.2?DataJSON platform:string = AppWebViewResult;
|
messages.requestAppWebView#8c5a3b3c flags:# write_allowed:flags.0?true peer:InputPeer app:InputBotApp start_param:flags.1?string theme_params:flags.2?DataJSON platform:string = AppWebViewResult;
|
||||||
messages.setChatWallPaper#bddd7eaa peer:InputPeer wallpaper:InputWallPaper settings:WallPaperSettings = Updates;
|
messages.setChatWallPaper#dbaaba25 flags:# peer:InputPeer wallpaper:flags.0?InputWallPaper settings:flags.0?WallPaperSettings id:flags.1?int = Updates;
|
||||||
|
|
||||||
updates.getState#edd4882a = updates.State;
|
updates.getState#edd4882a = updates.State;
|
||||||
updates.getDifference#25939651 flags:# pts:int pts_total_limit:flags.0?int date:int qts:int = updates.Difference;
|
updates.getDifference#25939651 flags:# pts:int pts_total_limit:flags.0?int date:int qts:int = updates.Difference;
|
||||||
|
@ -2061,16 +2062,16 @@ stats.getMegagroupStats#dcdf8607 flags:# dark:flags.0?true channel:InputChannel
|
||||||
stats.getMessagePublicForwards#5630281b channel:InputChannel msg_id:int offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages;
|
stats.getMessagePublicForwards#5630281b channel:InputChannel msg_id:int offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages;
|
||||||
stats.getMessageStats#b6e0a3f5 flags:# dark:flags.0?true channel:InputChannel msg_id:int = stats.MessageStats;
|
stats.getMessageStats#b6e0a3f5 flags:# dark:flags.0?true channel:InputChannel msg_id:int = stats.MessageStats;
|
||||||
|
|
||||||
communities.exportCommunityInvite#41fe69d9 community:InputCommunity title:string peers:Vector<InputPeer> = communities.ExportedCommunityInvite;
|
chatlists.exportChatlistInvite#8472478e chatlist:InputChatlist title:string peers:Vector<InputPeer> = chatlists.ExportedChatlistInvite;
|
||||||
communities.deleteExportedInvite#f96e4616 community:InputCommunity slug:string = Bool;
|
chatlists.deleteExportedInvite#719c5c5e chatlist:InputChatlist slug:string = Bool;
|
||||||
communities.editExportedInvite#27140512 flags:# community:InputCommunity slug:string title:flags.1?string peers:flags.2?Vector<InputPeer> = ExportedCommunityInvite;
|
chatlists.editExportedInvite#653db63d flags:# chatlist:InputChatlist slug:string title:flags.1?string peers:flags.2?Vector<InputPeer> = ExportedChatlistInvite;
|
||||||
communities.getExportedInvites#4688a39d community:InputCommunity = communities.ExportedInvites;
|
chatlists.getExportedInvites#ce03da83 chatlist:InputChatlist = chatlists.ExportedInvites;
|
||||||
communities.checkCommunityInvite#99ba9e5 slug:string = communities.CommunityInvite;
|
chatlists.checkChatlistInvite#41c10fff slug:string = chatlists.ChatlistInvite;
|
||||||
communities.joinCommunityInvite#4eff927 slug:string peers:Vector<InputPeer> = Updates;
|
chatlists.joinChatlistInvite#a6b1e39a slug:string peers:Vector<InputPeer> = Updates;
|
||||||
communities.getCommunityUpdates#2956d635 community:InputCommunity = communities.CommunityUpdates;
|
chatlists.getChatlistUpdates#89419521 chatlist:InputChatlist = chatlists.ChatlistUpdates;
|
||||||
communities.joinCommunityUpdates#51d42216 community:InputCommunity peers:Vector<InputPeer> = Updates;
|
chatlists.joinChatlistUpdates#e089f8f5 chatlist:InputChatlist peers:Vector<InputPeer> = Updates;
|
||||||
communities.hideCommunityUpdates#d678baf community:InputCommunity = Bool;
|
chatlists.hideChatlistUpdates#66e486fb chatlist:InputChatlist = Bool;
|
||||||
communities.getLeaveCommunitySuggestions#ee4e9ae2 community:InputCommunity = Vector<Peer>;
|
chatlists.getLeaveChatlistSuggestions#fdbcd714 chatlist:InputChatlist = Vector<Peer>;
|
||||||
communities.leaveCommunity#35d9755f community:InputCommunity peers:Vector<InputPeer> = Updates;
|
chatlists.leaveChatlist#74fae13a chatlist:InputChatlist peers:Vector<InputPeer> = Updates;
|
||||||
|
|
||||||
// LAYER 158
|
// LAYER 158
|
||||||
|
|
|
@ -216,7 +216,7 @@ void ImportInvite(
|
||||||
auto inputs = peers | ranges::views::transform([](auto peer) {
|
auto inputs = peers | ranges::views::transform([](auto peer) {
|
||||||
return MTPInputPeer(peer->input);
|
return MTPInputPeer(peer->input);
|
||||||
}) | ranges::to<QVector>();
|
}) | ranges::to<QVector>();
|
||||||
api->request(MTPcommunities_JoinCommunityInvite(
|
api->request(MTPchatlists_JoinChatlistInvite(
|
||||||
MTP_string(slug),
|
MTP_string(slug),
|
||||||
MTP_vector<MTPInputPeer>(std::move(inputs))
|
MTP_vector<MTPInputPeer>(std::move(inputs))
|
||||||
)).done(callback).fail(error).send();
|
)).done(callback).fail(error).send();
|
||||||
|
@ -527,7 +527,7 @@ void CheckFilterInvite(
|
||||||
const auto session = &controller->session();
|
const auto session = &controller->session();
|
||||||
const auto weak = base::make_weak(controller);
|
const auto weak = base::make_weak(controller);
|
||||||
session->api().checkFilterInvite(slug, [=](
|
session->api().checkFilterInvite(slug, [=](
|
||||||
const MTPcommunities_CommunityInvite &result) {
|
const MTPchatlists_ChatlistInvite &result) {
|
||||||
const auto strong = weak.get();
|
const auto strong = weak.get();
|
||||||
if (!strong) {
|
if (!strong) {
|
||||||
return;
|
return;
|
||||||
|
@ -550,11 +550,11 @@ void CheckFilterInvite(
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
result.match([&](const MTPDcommunities_communityInvite &data) {
|
result.match([&](const MTPDchatlists_chatlistInvite &data) {
|
||||||
title = qs(data.vtitle());
|
title = qs(data.vtitle());
|
||||||
iconEmoji = data.vemoticon().value_or_empty();
|
iconEmoji = data.vemoticon().value_or_empty();
|
||||||
peers = parseList(data.vpeers());
|
peers = parseList(data.vpeers());
|
||||||
}, [&](const MTPDcommunities_communityInviteAlready &data) {
|
}, [&](const MTPDchatlists_chatlistInviteAlready &data) {
|
||||||
filterId = data.vfilter_id().v;
|
filterId = data.vfilter_id().v;
|
||||||
peers = parseList(data.vmissing_peers());
|
peers = parseList(data.vmissing_peers());
|
||||||
already = parseList(data.valready_peers());
|
already = parseList(data.valready_peers());
|
||||||
|
|
|
@ -58,7 +58,7 @@ JoinedByLinkSlice ParseJoinedByLinkSlice(
|
||||||
result.users.push_back({
|
result.users.push_back({
|
||||||
.user = owner.user(data.vuser_id()),
|
.user = owner.user(data.vuser_id()),
|
||||||
.date = data.vdate().v,
|
.date = data.vdate().v,
|
||||||
.viaFilterLink = data.is_via_community(),
|
.viaFilterLink = data.is_via_chatlist(),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -382,11 +382,11 @@ void ApiWrap::checkChatInvite(
|
||||||
|
|
||||||
void ApiWrap::checkFilterInvite(
|
void ApiWrap::checkFilterInvite(
|
||||||
const QString &slug,
|
const QString &slug,
|
||||||
FnMut<void(const MTPcommunities_CommunityInvite &)> done,
|
FnMut<void(const MTPchatlists_ChatlistInvite &)> done,
|
||||||
Fn<void(const MTP::Error &)> fail) {
|
Fn<void(const MTP::Error &)> fail) {
|
||||||
request(base::take(_checkFilterInviteRequestId)).cancel();
|
request(base::take(_checkFilterInviteRequestId)).cancel();
|
||||||
_checkFilterInviteRequestId = request(
|
_checkFilterInviteRequestId = request(
|
||||||
MTPcommunities_CheckCommunityInvite(MTP_string(slug))
|
MTPchatlists_CheckChatlistInvite(MTP_string(slug))
|
||||||
).done(std::move(done)).fail(std::move(fail)).send();
|
).done(std::move(done)).fail(std::move(fail)).send();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -204,7 +204,7 @@ public:
|
||||||
Fn<void(const MTP::Error &)> fail);
|
Fn<void(const MTP::Error &)> fail);
|
||||||
void checkFilterInvite(
|
void checkFilterInvite(
|
||||||
const QString &slug,
|
const QString &slug,
|
||||||
FnMut<void(const MTPcommunities_CommunityInvite &)> done,
|
FnMut<void(const MTPchatlists_ChatlistInvite &)> done,
|
||||||
Fn<void(const MTP::Error &)> fail);
|
Fn<void(const MTP::Error &)> fail);
|
||||||
|
|
||||||
void processFullPeer(
|
void processFullPeer(
|
||||||
|
|
|
@ -554,19 +554,19 @@ void EditFilterBox(
|
||||||
rpl::variable<Data::ChatFilter> rules;
|
rpl::variable<Data::ChatFilter> rules;
|
||||||
rpl::variable<std::vector<Data::ChatFilterLink>> links;
|
rpl::variable<std::vector<Data::ChatFilterLink>> links;
|
||||||
rpl::variable<bool> hasLinks;
|
rpl::variable<bool> hasLinks;
|
||||||
rpl::variable<bool> community;
|
rpl::variable<bool> chatlist;
|
||||||
};
|
};
|
||||||
const auto owner = &window->session().data();
|
const auto owner = &window->session().data();
|
||||||
const auto state = box->lifetime().make_state<State>(State{
|
const auto state = box->lifetime().make_state<State>(State{
|
||||||
.rules = filter,
|
.rules = filter,
|
||||||
.community = filter.community(),
|
.chatlist = filter.chatlist(),
|
||||||
});
|
});
|
||||||
state->links = owner->chatsFilters().communityLinks(filter.id()),
|
state->links = owner->chatsFilters().chatlistLinks(filter.id()),
|
||||||
state->hasLinks = state->links.value() | rpl::map([=](const auto &v) {
|
state->hasLinks = state->links.value() | rpl::map([=](const auto &v) {
|
||||||
return !v.empty();
|
return !v.empty();
|
||||||
});
|
});
|
||||||
if (!state->community.current()) {
|
if (!state->chatlist.current()) {
|
||||||
state->community = state->hasLinks.value() | rpl::filter(
|
state->chatlist = state->hasLinks.value() | rpl::filter(
|
||||||
_1
|
_1
|
||||||
) | rpl::take(1);
|
) | rpl::take(1);
|
||||||
}
|
}
|
||||||
|
@ -657,7 +657,7 @@ void EditFilterBox(
|
||||||
content,
|
content,
|
||||||
object_ptr<Ui::VerticalLayout>(content))
|
object_ptr<Ui::VerticalLayout>(content))
|
||||||
)->setDuration(0);
|
)->setDuration(0);
|
||||||
excludeWrap->toggleOn(state->community.value() | rpl::map(!_1));
|
excludeWrap->toggleOn(state->chatlist.value() | rpl::map(!_1));
|
||||||
const auto excludeInner = excludeWrap->entity();
|
const auto excludeInner = excludeWrap->entity();
|
||||||
|
|
||||||
AddSubsectionTitle(excludeInner, tr::lng_filters_exclude());
|
AddSubsectionTitle(excludeInner, tr::lng_filters_exclude());
|
||||||
|
@ -717,8 +717,8 @@ void EditFilterBox(
|
||||||
content->resizeToWidth(content->widthNoMargins());
|
content->resizeToWidth(content->widthNoMargins());
|
||||||
}, content->lifetime());
|
}, content->lifetime());
|
||||||
|
|
||||||
if (filter.community()) {
|
if (filter.chatlist()) {
|
||||||
window->session().data().chatsFilters().reloadCommunityLinks(
|
window->session().data().chatsFilters().reloadChatlistLinks(
|
||||||
filter.id());
|
filter.id());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -763,13 +763,13 @@ void EditFilterBox(
|
||||||
// Comparison of ChatFilter-s don't take id into account!
|
// Comparison of ChatFilter-s don't take id into account!
|
||||||
data->force_assign(updated);
|
data->force_assign(updated);
|
||||||
const auto id = updated.id();
|
const auto id = updated.id();
|
||||||
state->links = owner->chatsFilters().communityLinks(id);
|
state->links = owner->chatsFilters().chatlistLinks(id);
|
||||||
ExportFilterLink(id, shared, [=](Data::ChatFilterLink link) {
|
ExportFilterLink(id, shared, [=](Data::ChatFilterLink link) {
|
||||||
Expects(link.id == id);
|
Expects(link.id == id);
|
||||||
|
|
||||||
window->show(ShowLinkBox(window, updated, link));
|
window->show(ShowLinkBox(window, updated, link));
|
||||||
}, [=](QString error) {
|
}, [=](QString error) {
|
||||||
if (error == "COMMUNITIES_TOO_MUCH") {
|
if (error == "CHATLISTS_TOO_MUCH") {
|
||||||
// #TODO filters
|
// #TODO filters
|
||||||
} else {
|
} else {
|
||||||
window->show(ShowLinkBox(window, updated, { .id = id }));
|
window->show(ShowLinkBox(window, updated, { .id = id }));
|
||||||
|
@ -799,7 +799,7 @@ void EditFilterBox(
|
||||||
EditExceptions(
|
EditExceptions(
|
||||||
window,
|
window,
|
||||||
box,
|
box,
|
||||||
kTypes | (state->community.current() ? Flag::Community : Flag()),
|
kTypes | (state->chatlist.current() ? Flag::Chatlist : Flag()),
|
||||||
data,
|
data,
|
||||||
updateDefaultTitle,
|
updateDefaultTitle,
|
||||||
refreshPreviews);
|
refreshPreviews);
|
||||||
|
|
|
@ -343,10 +343,10 @@ EditFilterChatsListController::EditFilterChatsListController(
|
||||||
, _session(session)
|
, _session(session)
|
||||||
, _title(std::move(title))
|
, _title(std::move(title))
|
||||||
, _peers(peers)
|
, _peers(peers)
|
||||||
, _options(options & ~Flag::Community)
|
, _options(options & ~Flag::Chatlist)
|
||||||
, _selected(selected)
|
, _selected(selected)
|
||||||
, _limit(Limit(session))
|
, _limit(Limit(session))
|
||||||
, _community(options & Flag::Community) {
|
, _chatlist(options & Flag::Chatlist) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Main::Session &EditFilterChatsListController::session() const {
|
Main::Session &EditFilterChatsListController::session() const {
|
||||||
|
@ -354,9 +354,9 @@ Main::Session &EditFilterChatsListController::session() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
int EditFilterChatsListController::selectedTypesCount() const {
|
int EditFilterChatsListController::selectedTypesCount() const {
|
||||||
Expects(_community || _typesDelegate != nullptr);
|
Expects(_chatlist || _typesDelegate != nullptr);
|
||||||
|
|
||||||
if (_community) {
|
if (_chatlist) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
auto result = 0;
|
auto result = 0;
|
||||||
|
@ -400,7 +400,7 @@ bool EditFilterChatsListController::handleDeselectForeignRow(
|
||||||
|
|
||||||
void EditFilterChatsListController::prepareViewHook() {
|
void EditFilterChatsListController::prepareViewHook() {
|
||||||
delegate()->peerListSetTitle(std::move(_title));
|
delegate()->peerListSetTitle(std::move(_title));
|
||||||
if (!_community) {
|
if (!_chatlist) {
|
||||||
delegate()->peerListSetAboveWidget(prepareTypesList());
|
delegate()->peerListSetAboveWidget(prepareTypesList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,7 @@ private:
|
||||||
Flags _options;
|
Flags _options;
|
||||||
Flags _selected;
|
Flags _selected;
|
||||||
int _limit = 0;
|
int _limit = 0;
|
||||||
bool _community = false;
|
bool _chatlist = false;
|
||||||
|
|
||||||
Fn<void(PeerListRowId)> _deselectOption;
|
Fn<void(PeerListRowId)> _deselectOption;
|
||||||
|
|
||||||
|
|
|
@ -606,7 +606,7 @@ void LinkController::addLinkBlock(not_null<Ui::VerticalLayout*> container) {
|
||||||
});
|
});
|
||||||
const auto getLinkQr = crl::guard(weak, [=] {
|
const auto getLinkQr = crl::guard(weak, [=] {
|
||||||
delegate()->peerListShowBox(
|
delegate()->peerListShowBox(
|
||||||
InviteLinkQrBox(link),
|
InviteLinkQrBox(link, tr::lng_filters_link_qr_about()),
|
||||||
Ui::LayerOption::KeepOther);
|
Ui::LayerOption::KeepOther);
|
||||||
});
|
});
|
||||||
const auto editLink = crl::guard(weak, [=] {
|
const auto editLink = crl::guard(weak, [=] {
|
||||||
|
@ -885,7 +885,7 @@ base::unique_qptr<Ui::PopupMenu> LinksController::createRowContextMenu(
|
||||||
};
|
};
|
||||||
const auto getLinkQr = [=] {
|
const auto getLinkQr = [=] {
|
||||||
delegate()->peerListShowBox(
|
delegate()->peerListShowBox(
|
||||||
InviteLinkQrBox(link),
|
InviteLinkQrBox(link, tr::lng_filters_link_qr_about()),
|
||||||
Ui::LayerOption::KeepOther);
|
Ui::LayerOption::KeepOther);
|
||||||
};
|
};
|
||||||
const auto editLink = [=] {
|
const auto editLink = [=] {
|
||||||
|
@ -1040,7 +1040,7 @@ bool GoodForExportFilterLink(
|
||||||
not_null<Window::SessionController*> window,
|
not_null<Window::SessionController*> window,
|
||||||
const Data::ChatFilter &filter) {
|
const Data::ChatFilter &filter) {
|
||||||
using Flag = Data::ChatFilter::Flag;
|
using Flag = Data::ChatFilter::Flag;
|
||||||
if (!filter.never().empty() || (filter.flags() & ~Flag::Community)) {
|
if (!filter.never().empty() || (filter.flags() & ~Flag::Chatlist)) {
|
||||||
Ui::ShowMultilineToast({
|
Ui::ShowMultilineToast({
|
||||||
.parentOverride = Window::Show(window).toastParent(),
|
.parentOverride = Window::Show(window).toastParent(),
|
||||||
.text = { tr::lng_filters_link_cant(tr::now) },
|
.text = { tr::lng_filters_link_cant(tr::now) },
|
||||||
|
@ -1062,11 +1062,11 @@ void ExportFilterLink(
|
||||||
auto mtpPeers = peers | ranges::views::transform(
|
auto mtpPeers = peers | ranges::views::transform(
|
||||||
[](not_null<PeerData*> peer) { return MTPInputPeer(peer->input); }
|
[](not_null<PeerData*> peer) { return MTPInputPeer(peer->input); }
|
||||||
) | ranges::to<QVector>();
|
) | ranges::to<QVector>();
|
||||||
session->api().request(MTPcommunities_ExportCommunityInvite(
|
session->api().request(MTPchatlists_ExportChatlistInvite(
|
||||||
MTP_inputCommunityDialogFilter(MTP_int(id)),
|
MTP_inputChatlistDialogFilter(MTP_int(id)),
|
||||||
MTP_string(), // title
|
MTP_string(), // title
|
||||||
MTP_vector<MTPInputPeer>(std::move(mtpPeers))
|
MTP_vector<MTPInputPeer>(std::move(mtpPeers))
|
||||||
)).done([=](const MTPcommunities_ExportedCommunityInvite &result) {
|
)).done([=](const MTPchatlists_ExportedChatlistInvite &result) {
|
||||||
const auto &data = result.data();
|
const auto &data = result.data();
|
||||||
session->data().chatsFilters().apply(MTP_updateDialogFilter(
|
session->data().chatsFilters().apply(MTP_updateDialogFilter(
|
||||||
MTP_flags(MTPDupdateDialogFilter::Flag::f_filter),
|
MTP_flags(MTPDupdateDialogFilter::Flag::f_filter),
|
||||||
|
@ -1094,13 +1094,13 @@ void EditLinkChats(
|
||||||
auto mtpPeers = peers | ranges::views::transform(
|
auto mtpPeers = peers | ranges::views::transform(
|
||||||
[](not_null<PeerData*> peer) { return MTPInputPeer(peer->input); }
|
[](not_null<PeerData*> peer) { return MTPInputPeer(peer->input); }
|
||||||
) | ranges::to<QVector>();
|
) | ranges::to<QVector>();
|
||||||
session->api().request(MTPcommunities_EditExportedInvite(
|
session->api().request(MTPchatlists_EditExportedInvite(
|
||||||
MTP_flags(MTPcommunities_EditExportedInvite::Flag::f_peers),
|
MTP_flags(MTPchatlists_EditExportedInvite::Flag::f_peers),
|
||||||
MTP_inputCommunityDialogFilter(MTP_int(link.id)),
|
MTP_inputChatlistDialogFilter(MTP_int(link.id)),
|
||||||
MTP_string(link.url),
|
MTP_string(link.url),
|
||||||
MTPstring(), // title
|
MTPstring(), // title
|
||||||
MTP_vector<MTPInputPeer>(std::move(mtpPeers))
|
MTP_vector<MTPInputPeer>(std::move(mtpPeers))
|
||||||
)).done([=](const MTPExportedCommunityInvite &result) {
|
)).done([=](const MTPExportedChatlistInvite &result) {
|
||||||
const auto &data = result.data();
|
const auto &data = result.data();
|
||||||
const auto link = session->data().chatsFilters().add(id, result);
|
const auto link = session->data().chatsFilters().add(id, result);
|
||||||
//done(link);
|
//done(link);
|
||||||
|
|
|
@ -274,6 +274,7 @@ QImage QrForShare(const QString &text) {
|
||||||
void QrBox(
|
void QrBox(
|
||||||
not_null<Ui::GenericBox*> box,
|
not_null<Ui::GenericBox*> box,
|
||||||
const QString &link,
|
const QString &link,
|
||||||
|
rpl::producer<QString> about,
|
||||||
Fn<void(QImage, std::shared_ptr<Ui::BoxShow>)> share) {
|
Fn<void(QImage, std::shared_ptr<Ui::BoxShow>)> share) {
|
||||||
box->setTitle(tr::lng_group_invite_qr_title());
|
box->setTitle(tr::lng_group_invite_qr_title());
|
||||||
|
|
||||||
|
@ -307,7 +308,7 @@ void QrBox(
|
||||||
box->addRow(
|
box->addRow(
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
box,
|
box,
|
||||||
tr::lng_group_invite_qr_about(),
|
std::move(about),
|
||||||
st::boxLabel),
|
st::boxLabel),
|
||||||
st::inviteLinkQrValuePadding);
|
st::inviteLinkQrValuePadding);
|
||||||
|
|
||||||
|
@ -354,7 +355,7 @@ void Controller::addHeaderBlock(not_null<Ui::VerticalLayout*> container) {
|
||||||
});
|
});
|
||||||
const auto getLinkQr = crl::guard(weak, [=] {
|
const auto getLinkQr = crl::guard(weak, [=] {
|
||||||
delegate()->peerListShowBox(
|
delegate()->peerListShowBox(
|
||||||
InviteLinkQrBox(link),
|
InviteLinkQrBox(link, tr::lng_group_invite_qr_about()),
|
||||||
Ui::LayerOption::KeepOther);
|
Ui::LayerOption::KeepOther);
|
||||||
});
|
});
|
||||||
const auto revokeLink = crl::guard(weak, [=] {
|
const auto revokeLink = crl::guard(weak, [=] {
|
||||||
|
@ -973,7 +974,9 @@ void AddPermanentLinkBlock(
|
||||||
const auto getLinkQr = crl::guard(weak, [=] {
|
const auto getLinkQr = crl::guard(weak, [=] {
|
||||||
if (const auto current = value->current(); !current.link.isEmpty()) {
|
if (const auto current = value->current(); !current.link.isEmpty()) {
|
||||||
show->showBox(
|
show->showBox(
|
||||||
InviteLinkQrBox(current.link),
|
InviteLinkQrBox(
|
||||||
|
current.link,
|
||||||
|
tr::lng_group_invite_qr_about()),
|
||||||
Ui::LayerOption::KeepOther);
|
Ui::LayerOption::KeepOther);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1224,8 +1227,10 @@ object_ptr<Ui::BoxContent> ShareInviteLinkBox(
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
|
|
||||||
object_ptr<Ui::BoxContent> InviteLinkQrBox(const QString &link) {
|
object_ptr<Ui::BoxContent> InviteLinkQrBox(
|
||||||
return Box(QrBox, link, [=](
|
const QString &link,
|
||||||
|
rpl::producer<QString> about) {
|
||||||
|
return Box(QrBox, link, std::move(about), [=](
|
||||||
const QImage &image,
|
const QImage &image,
|
||||||
std::shared_ptr<Ui::BoxShow> show) {
|
std::shared_ptr<Ui::BoxShow> show) {
|
||||||
auto mime = std::make_unique<QMimeData>();
|
auto mime = std::make_unique<QMimeData>();
|
||||||
|
|
|
@ -45,7 +45,9 @@ void CopyInviteLink(not_null<QWidget*> toastParent, const QString &link);
|
||||||
[[nodiscard]] object_ptr<Ui::BoxContent> ShareInviteLinkBox(
|
[[nodiscard]] object_ptr<Ui::BoxContent> ShareInviteLinkBox(
|
||||||
not_null<Main::Session*> session,
|
not_null<Main::Session*> session,
|
||||||
const QString &link);
|
const QString &link);
|
||||||
[[nodiscard]] object_ptr<Ui::BoxContent> InviteLinkQrBox(const QString &link);
|
[[nodiscard]] object_ptr<Ui::BoxContent> InviteLinkQrBox(
|
||||||
|
const QString &link,
|
||||||
|
rpl::producer<QString> about);
|
||||||
[[nodiscard]] object_ptr<Ui::BoxContent> RevokeLinkBox(
|
[[nodiscard]] object_ptr<Ui::BoxContent> RevokeLinkBox(
|
||||||
not_null<PeerData*> peer,
|
not_null<PeerData*> peer,
|
||||||
not_null<UserData*> admin,
|
not_null<UserData*> admin,
|
||||||
|
|
|
@ -594,7 +594,7 @@ base::unique_qptr<Ui::PopupMenu> LinksController::createRowContextMenu(
|
||||||
}, &st::menuIconShare);
|
}, &st::menuIconShare);
|
||||||
result->addAction(tr::lng_group_invite_context_qr(tr::now), [=] {
|
result->addAction(tr::lng_group_invite_context_qr(tr::now), [=] {
|
||||||
delegate()->peerListShowBox(
|
delegate()->peerListShowBox(
|
||||||
InviteLinkQrBox(link),
|
InviteLinkQrBox(link, tr::lng_group_invite_qr_about()),
|
||||||
Ui::LayerOption::KeepOther);
|
Ui::LayerOption::KeepOther);
|
||||||
}, &st::menuIconQrCode);
|
}, &st::menuIconQrCode);
|
||||||
result->addAction(tr::lng_group_invite_context_edit(tr::now), [=] {
|
result->addAction(tr::lng_group_invite_context_edit(tr::now), [=] {
|
||||||
|
|
|
@ -109,7 +109,7 @@ ChatFilter ChatFilter::FromTL(
|
||||||
{ never.begin(), never.end() });
|
{ never.begin(), never.end() });
|
||||||
}, [](const MTPDdialogFilterDefault &d) {
|
}, [](const MTPDdialogFilterDefault &d) {
|
||||||
return ChatFilter();
|
return ChatFilter();
|
||||||
}, [&](const MTPDdialogFilterCommunity &data) {
|
}, [&](const MTPDdialogFilterChatlist &data) {
|
||||||
auto &&to_histories = ranges::views::transform([&](
|
auto &&to_histories = ranges::views::transform([&](
|
||||||
const MTPInputPeer &data) {
|
const MTPInputPeer &data) {
|
||||||
const auto peer = data.match([&](const MTPDinputPeerUser &data) {
|
const auto peer = data.match([&](const MTPDinputPeerUser &data) {
|
||||||
|
@ -148,7 +148,7 @@ ChatFilter ChatFilter::FromTL(
|
||||||
data.vid().v,
|
data.vid().v,
|
||||||
qs(data.vtitle()),
|
qs(data.vtitle()),
|
||||||
qs(data.vemoticon().value_or_empty()),
|
qs(data.vemoticon().value_or_empty()),
|
||||||
Flag::Community,
|
Flag::Chatlist,
|
||||||
std::move(list),
|
std::move(list),
|
||||||
std::move(pinned),
|
std::move(pinned),
|
||||||
{});
|
{});
|
||||||
|
@ -174,10 +174,10 @@ MTPDialogFilter ChatFilter::tl(FilterId replaceId) const {
|
||||||
for (const auto &history : always) {
|
for (const auto &history : always) {
|
||||||
include.push_back(history->peer->input);
|
include.push_back(history->peer->input);
|
||||||
}
|
}
|
||||||
if (_flags & Flag::Community) {
|
if (_flags & Flag::Chatlist) {
|
||||||
using TLFlag = MTPDdialogFilterCommunity::Flag;
|
using TLFlag = MTPDdialogFilterChatlist::Flag;
|
||||||
const auto flags = TLFlag::f_emoticon;
|
const auto flags = TLFlag::f_emoticon;
|
||||||
return MTP_dialogFilterCommunity(
|
return MTP_dialogFilterChatlist(
|
||||||
MTP_flags(flags),
|
MTP_flags(flags),
|
||||||
MTP_int(replaceId ? replaceId : _id),
|
MTP_int(replaceId ? replaceId : _id),
|
||||||
MTP_string(_title),
|
MTP_string(_title),
|
||||||
|
@ -228,8 +228,8 @@ ChatFilter::Flags ChatFilter::flags() const {
|
||||||
return _flags;
|
return _flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ChatFilter::community() const {
|
bool ChatFilter::chatlist() const {
|
||||||
return _flags & Flag::Community;
|
return _flags & Flag::Chatlist;
|
||||||
}
|
}
|
||||||
|
|
||||||
const base::flat_set<not_null<History*>> &ChatFilter::always() const {
|
const base::flat_set<not_null<History*>> &ChatFilter::always() const {
|
||||||
|
@ -410,15 +410,15 @@ void ChatFilters::apply(const MTPUpdate &update) {
|
||||||
|
|
||||||
ChatFilterLink ChatFilters::add(
|
ChatFilterLink ChatFilters::add(
|
||||||
FilterId id,
|
FilterId id,
|
||||||
const MTPExportedCommunityInvite &update) {
|
const MTPExportedChatlistInvite &update) {
|
||||||
const auto i = ranges::find(_list, id, &ChatFilter::id);
|
const auto i = ranges::find(_list, id, &ChatFilter::id);
|
||||||
if (i == end(_list) || !i->community()) {
|
if (i == end(_list) || !i->chatlist()) {
|
||||||
LOG(("Api Error: "
|
LOG(("Api Error: "
|
||||||
"Attempt to add community link to a non-community filter: %1"
|
"Attempt to add chatlist link to a non-chatlist filter: %1"
|
||||||
).arg(id));
|
).arg(id));
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
auto &links = _communityLinks[id];
|
auto &links = _chatlistLinks[id];
|
||||||
const auto &data = update.data();
|
const auto &data = update.data();
|
||||||
const auto url = qs(data.vurl());
|
const auto url = qs(data.vurl());
|
||||||
const auto title = qs(data.vtitle());
|
const auto title = qs(data.vtitle());
|
||||||
|
@ -431,7 +431,7 @@ ChatFilterLink ChatFilters::add(
|
||||||
if (j->title != title || j->chats != chats) {
|
if (j->title != title || j->chats != chats) {
|
||||||
j->title = title;
|
j->title = title;
|
||||||
j->chats = std::move(chats);
|
j->chats = std::move(chats);
|
||||||
_communityLinksUpdated.fire_copy(id);
|
_chatlistLinksUpdated.fire_copy(id);
|
||||||
}
|
}
|
||||||
return *j;
|
return *j;
|
||||||
}
|
}
|
||||||
|
@ -441,7 +441,7 @@ ChatFilterLink ChatFilters::add(
|
||||||
.title = title,
|
.title = title,
|
||||||
.chats = std::move(chats),
|
.chats = std::move(chats),
|
||||||
});
|
});
|
||||||
_communityLinksUpdated.fire_copy(id);
|
_chatlistLinksUpdated.fire_copy(id);
|
||||||
return links.back();
|
return links.back();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -449,19 +449,19 @@ void ChatFilters::edit(
|
||||||
FilterId id,
|
FilterId id,
|
||||||
const QString &url,
|
const QString &url,
|
||||||
const QString &title) {
|
const QString &title) {
|
||||||
auto &links = _communityLinks[id];
|
auto &links = _chatlistLinks[id];
|
||||||
const auto i = ranges::find(links, url, &ChatFilterLink::url);
|
const auto i = ranges::find(links, url, &ChatFilterLink::url);
|
||||||
if (i != end(links)) {
|
if (i != end(links)) {
|
||||||
i->title = title;
|
i->title = title;
|
||||||
_communityLinksUpdated.fire_copy(id);
|
_chatlistLinksUpdated.fire_copy(id);
|
||||||
|
|
||||||
_owner->session().api().request(MTPcommunities_EditExportedInvite(
|
_owner->session().api().request(MTPchatlists_EditExportedInvite(
|
||||||
MTP_flags(MTPcommunities_EditExportedInvite::Flag::f_title),
|
MTP_flags(MTPchatlists_EditExportedInvite::Flag::f_title),
|
||||||
MTP_inputCommunityDialogFilter(MTP_int(id)),
|
MTP_inputChatlistDialogFilter(MTP_int(id)),
|
||||||
MTP_string(url),
|
MTP_string(url),
|
||||||
MTP_string(title),
|
MTP_string(title),
|
||||||
MTPVector<MTPInputPeer>() // peers
|
MTPVector<MTPInputPeer>() // peers
|
||||||
)).done([=](const MTPExportedCommunityInvite &result) {
|
)).done([=](const MTPExportedChatlistInvite &result) {
|
||||||
//const auto &data = result.data();
|
//const auto &data = result.data();
|
||||||
//const auto link = _owner->chatsFilters().add(id, result);
|
//const auto link = _owner->chatsFilters().add(id, result);
|
||||||
//done(link);
|
//done(link);
|
||||||
|
@ -472,47 +472,47 @@ void ChatFilters::edit(
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatFilters::destroy(FilterId id, const QString &url) {
|
void ChatFilters::destroy(FilterId id, const QString &url) {
|
||||||
auto &links = _communityLinks[id];
|
auto &links = _chatlistLinks[id];
|
||||||
const auto i = ranges::find(links, url, &ChatFilterLink::url);
|
const auto i = ranges::find(links, url, &ChatFilterLink::url);
|
||||||
if (i != end(links)) {
|
if (i != end(links)) {
|
||||||
links.erase(i);
|
links.erase(i);
|
||||||
_communityLinksUpdated.fire_copy(id);
|
_chatlistLinksUpdated.fire_copy(id);
|
||||||
|
|
||||||
const auto api = &_owner->session().api();
|
const auto api = &_owner->session().api();
|
||||||
api->request(_linksRequestId).cancel();
|
api->request(_linksRequestId).cancel();
|
||||||
_linksRequestId = api->request(MTPcommunities_DeleteExportedInvite(
|
_linksRequestId = api->request(MTPchatlists_DeleteExportedInvite(
|
||||||
MTP_inputCommunityDialogFilter(MTP_int(id)),
|
MTP_inputChatlistDialogFilter(MTP_int(id)),
|
||||||
MTP_string(url)
|
MTP_string(url)
|
||||||
)).send();
|
)).send();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rpl::producer<std::vector<ChatFilterLink>> ChatFilters::communityLinks(
|
rpl::producer<std::vector<ChatFilterLink>> ChatFilters::chatlistLinks(
|
||||||
FilterId id) const {
|
FilterId id) const {
|
||||||
return _communityLinksUpdated.events_starting_with_copy(
|
return _chatlistLinksUpdated.events_starting_with_copy(
|
||||||
id
|
id
|
||||||
) | rpl::filter(rpl::mappers::_1 == id) | rpl::map([=] {
|
) | rpl::filter(rpl::mappers::_1 == id) | rpl::map([=] {
|
||||||
const auto i = _communityLinks.find(id);
|
const auto i = _chatlistLinks.find(id);
|
||||||
return (i != end(_communityLinks))
|
return (i != end(_chatlistLinks))
|
||||||
? i->second
|
? i->second
|
||||||
: std::vector<ChatFilterLink>();
|
: std::vector<ChatFilterLink>();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatFilters::reloadCommunityLinks(FilterId id) {
|
void ChatFilters::reloadChatlistLinks(FilterId id) {
|
||||||
const auto api = &_owner->session().api();
|
const auto api = &_owner->session().api();
|
||||||
api->request(_linksRequestId).cancel();
|
api->request(_linksRequestId).cancel();
|
||||||
_linksRequestId = api->request(MTPcommunities_GetExportedInvites(
|
_linksRequestId = api->request(MTPchatlists_GetExportedInvites(
|
||||||
MTP_inputCommunityDialogFilter(MTP_int(id))
|
MTP_inputChatlistDialogFilter(MTP_int(id))
|
||||||
)).done([=](const MTPcommunities_ExportedInvites &result) {
|
)).done([=](const MTPchatlists_ExportedInvites &result) {
|
||||||
const auto &data = result.data();
|
const auto &data = result.data();
|
||||||
_owner->processUsers(data.vusers());
|
_owner->processUsers(data.vusers());
|
||||||
_owner->processChats(data.vchats());
|
_owner->processChats(data.vchats());
|
||||||
_communityLinks[id].clear();
|
_chatlistLinks[id].clear();
|
||||||
for (const auto &link : data.vinvites().v) {
|
for (const auto &link : data.vinvites().v) {
|
||||||
add(id, link);
|
add(id, link);
|
||||||
}
|
}
|
||||||
_communityLinksUpdated.fire_copy(id);
|
_chatlistLinksUpdated.fire_copy(id);
|
||||||
}).send();
|
}).send();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ public:
|
||||||
NoRead = (1 << 6),
|
NoRead = (1 << 6),
|
||||||
NoArchived = (1 << 7),
|
NoArchived = (1 << 7),
|
||||||
|
|
||||||
Community = (1 << 8),
|
Chatlist = (1 << 8),
|
||||||
};
|
};
|
||||||
friend constexpr inline bool is_flag_type(Flag) { return true; };
|
friend constexpr inline bool is_flag_type(Flag) { return true; };
|
||||||
using Flags = base::flags<Flag>;
|
using Flags = base::flags<Flag>;
|
||||||
|
@ -58,7 +58,7 @@ public:
|
||||||
[[nodiscard]] QString title() const;
|
[[nodiscard]] QString title() const;
|
||||||
[[nodiscard]] QString iconEmoji() const;
|
[[nodiscard]] QString iconEmoji() const;
|
||||||
[[nodiscard]] Flags flags() const;
|
[[nodiscard]] Flags flags() const;
|
||||||
[[nodiscard]] bool community() const;
|
[[nodiscard]] bool chatlist() const;
|
||||||
[[nodiscard]] const base::flat_set<not_null<History*>> &always() const;
|
[[nodiscard]] const base::flat_set<not_null<History*>> &always() const;
|
||||||
[[nodiscard]] const std::vector<not_null<History*>> &pinned() const;
|
[[nodiscard]] const std::vector<not_null<History*>> &pinned() const;
|
||||||
[[nodiscard]] const base::flat_set<not_null<History*>> &never() const;
|
[[nodiscard]] const base::flat_set<not_null<History*>> &never() const;
|
||||||
|
@ -149,15 +149,15 @@ public:
|
||||||
|
|
||||||
ChatFilterLink add(
|
ChatFilterLink add(
|
||||||
FilterId id,
|
FilterId id,
|
||||||
const MTPExportedCommunityInvite &update);
|
const MTPExportedChatlistInvite &update);
|
||||||
void edit(
|
void edit(
|
||||||
FilterId id,
|
FilterId id,
|
||||||
const QString &url,
|
const QString &url,
|
||||||
const QString &title);
|
const QString &title);
|
||||||
void destroy(FilterId id, const QString &url);
|
void destroy(FilterId id, const QString &url);
|
||||||
rpl::producer<std::vector<ChatFilterLink>> communityLinks(
|
rpl::producer<std::vector<ChatFilterLink>> chatlistLinks(
|
||||||
FilterId id) const;
|
FilterId id) const;
|
||||||
void reloadCommunityLinks(FilterId id);
|
void reloadChatlistLinks(FilterId id);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void load(bool force);
|
void load(bool force);
|
||||||
|
@ -186,8 +186,8 @@ private:
|
||||||
std::deque<FilterId> _exceptionsToLoad;
|
std::deque<FilterId> _exceptionsToLoad;
|
||||||
mtpRequestId _exceptionsLoadRequestId = 0;
|
mtpRequestId _exceptionsLoadRequestId = 0;
|
||||||
|
|
||||||
base::flat_map<FilterId, std::vector<ChatFilterLink>> _communityLinks;
|
base::flat_map<FilterId, std::vector<ChatFilterLink>> _chatlistLinks;
|
||||||
rpl::event_stream<FilterId> _communityLinksUpdated;
|
rpl::event_stream<FilterId> _chatlistLinksUpdated;
|
||||||
mtpRequestId _linksRequestId = 0;
|
mtpRequestId _linksRequestId = 0;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -1186,6 +1186,8 @@ ServiceAction ParseServiceAction(
|
||||||
auto content = ActionSetChatWallPaper();
|
auto content = ActionSetChatWallPaper();
|
||||||
// #TODO wallpapers
|
// #TODO wallpapers
|
||||||
result.content = content;
|
result.content = content;
|
||||||
|
}, [&](const MTPDmessageActionSetSameChatWallPaper &data) {
|
||||||
|
result.content = ActionSetSameChatWallPaper();
|
||||||
}, [&](const MTPDmessageActionRequestedPeer &data) {
|
}, [&](const MTPDmessageActionRequestedPeer &data) {
|
||||||
auto content = ActionRequestedPeer();
|
auto content = ActionRequestedPeer();
|
||||||
content.peerId = ParsePeerId(data.vpeer());
|
content.peerId = ParsePeerId(data.vpeer());
|
||||||
|
|
|
@ -519,6 +519,9 @@ struct ActionSetChatWallPaper {
|
||||||
// #TODO wallpapers
|
// #TODO wallpapers
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct ActionSetSameChatWallPaper {
|
||||||
|
};
|
||||||
|
|
||||||
struct ActionRequestedPeer {
|
struct ActionRequestedPeer {
|
||||||
PeerId peerId = 0;
|
PeerId peerId = 0;
|
||||||
int buttonId = 0;
|
int buttonId = 0;
|
||||||
|
@ -561,7 +564,8 @@ struct ServiceAction {
|
||||||
ActionTopicEdit,
|
ActionTopicEdit,
|
||||||
ActionSuggestProfilePhoto,
|
ActionSuggestProfilePhoto,
|
||||||
ActionRequestedPeer,
|
ActionRequestedPeer,
|
||||||
ActionSetChatWallPaper> content;
|
ActionSetChatWallPaper,
|
||||||
|
ActionSetSameChatWallPaper> content;
|
||||||
};
|
};
|
||||||
|
|
||||||
ServiceAction ParseServiceAction(
|
ServiceAction ParseServiceAction(
|
||||||
|
|
|
@ -1175,6 +1175,11 @@ auto HtmlWriter::Wrap::pushMessage(
|
||||||
return "requested: "_q/* + data.peerId*/;
|
return "requested: "_q/* + data.peerId*/;
|
||||||
}, [&](const ActionSetChatWallPaper &data) {
|
}, [&](const ActionSetChatWallPaper &data) {
|
||||||
return serviceFrom + " set a new background for this chat";
|
return serviceFrom + " set a new background for this chat";
|
||||||
|
}, [&](const ActionSetSameChatWallPaper &data) {
|
||||||
|
return serviceFrom
|
||||||
|
+ " set "
|
||||||
|
+ wrapReplyToLink("the same background")
|
||||||
|
+ " for this chat";
|
||||||
}, [](v::null_t) { return QByteArray(); });
|
}, [](v::null_t) { return QByteArray(); });
|
||||||
|
|
||||||
if (!serviceText.isEmpty()) {
|
if (!serviceText.isEmpty()) {
|
||||||
|
|
|
@ -593,6 +593,10 @@ QByteArray SerializeMessage(
|
||||||
}, [&](const ActionSetChatWallPaper &data) {
|
}, [&](const ActionSetChatWallPaper &data) {
|
||||||
pushActor();
|
pushActor();
|
||||||
pushAction("set_chat_wallpaper");
|
pushAction("set_chat_wallpaper");
|
||||||
|
}, [&](const ActionSetSameChatWallPaper &data) {
|
||||||
|
pushActor();
|
||||||
|
pushAction("set_same_chat_wallpaper");
|
||||||
|
pushReplyToMsgId("message_id");
|
||||||
}, [](v::null_t) {});
|
}, [](v::null_t) {});
|
||||||
|
|
||||||
if (v::is_null(message.action.content)) {
|
if (v::is_null(message.action.content)) {
|
||||||
|
|
|
@ -1392,7 +1392,7 @@ void GenerateItems(
|
||||||
|
|
||||||
const auto createParticipantJoinByInvite = [&](
|
const auto createParticipantJoinByInvite = [&](
|
||||||
const LogJoinByInvite &data) {
|
const LogJoinByInvite &data) {
|
||||||
const auto text = data.is_via_community()
|
const auto text = data.is_via_chatlist()
|
||||||
? (channel->isMegagroup()
|
? (channel->isMegagroup()
|
||||||
? tr::lng_admin_log_participant_joined_by_filter_link
|
? tr::lng_admin_log_participant_joined_by_filter_link
|
||||||
: tr::lng_admin_log_participant_joined_by_filter_link_channel)
|
: tr::lng_admin_log_participant_joined_by_filter_link_channel)
|
||||||
|
|
|
@ -672,6 +672,8 @@ HistoryServiceDependentData *HistoryItem::GetServiceDependentData() {
|
||||||
return payment;
|
return payment;
|
||||||
} else if (const auto info = Get<HistoryServiceTopicInfo>()) {
|
} else if (const auto info = Get<HistoryServiceTopicInfo>()) {
|
||||||
return info;
|
return info;
|
||||||
|
} else if (const auto same = Get<HistoryServiceSameBackground>()) {
|
||||||
|
return same;
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
@ -3426,6 +3428,8 @@ void HistoryItem::createServiceFromMtp(const MTPDmessageService &message) {
|
||||||
}
|
}
|
||||||
}, call->lifetime);
|
}, call->lifetime);
|
||||||
}
|
}
|
||||||
|
} else if (type == mtpc_messageActionSetSameChatWallPaper) {
|
||||||
|
UpdateComponents(HistoryServiceSameBackground::Bit());
|
||||||
}
|
}
|
||||||
if (const auto replyTo = message.vreply_to()) {
|
if (const auto replyTo = message.vreply_to()) {
|
||||||
replyTo->match([&](const MTPDmessageReplyHeader &data) {
|
replyTo->match([&](const MTPDmessageReplyHeader &data) {
|
||||||
|
@ -4177,6 +4181,37 @@ void HistoryItem::setServiceMessageByAction(const MTPmessageAction &action) {
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
auto prepareSetSameChatWallPaper = [&](
|
||||||
|
const MTPDmessageActionSetSameChatWallPaper &action) {
|
||||||
|
const auto isSelf = (_from->id == _from->session().userPeerId());
|
||||||
|
const auto peer = isSelf ? history()->peer : _from;
|
||||||
|
const auto user = peer->asUser();
|
||||||
|
const auto name = (user && !user->firstName.isEmpty())
|
||||||
|
? user->firstName
|
||||||
|
: peer->name();
|
||||||
|
auto result = PreparedServiceText{};
|
||||||
|
if (!isSelf) {
|
||||||
|
result.links.push_back(peer->createOpenLink());
|
||||||
|
}
|
||||||
|
if (const auto dependent = GetServiceDependentData()) {
|
||||||
|
result.links.push_back(dependent->lnk);
|
||||||
|
}
|
||||||
|
result.text = isSelf
|
||||||
|
? tr::lng_action_set_same_wallpaper(
|
||||||
|
tr::now,
|
||||||
|
lt_user,
|
||||||
|
Ui::Text::Link(name, 1), // Link 1.
|
||||||
|
lt_background,
|
||||||
|
Ui::Text::Link(tr::lng_action_set_same_background(tr::now), 2),
|
||||||
|
Ui::Text::WithEntities)
|
||||||
|
: tr::lng_action_set_same_wallpaper_me(
|
||||||
|
tr::now,
|
||||||
|
lt_background,
|
||||||
|
Ui::Text::Link(tr::lng_action_set_same_background(tr::now), 1),
|
||||||
|
Ui::Text::WithEntities);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
|
||||||
setServiceText(action.match([&](
|
setServiceText(action.match([&](
|
||||||
const MTPDmessageActionChatAddUser &data) {
|
const MTPDmessageActionChatAddUser &data) {
|
||||||
return prepareChatAddUserText(data);
|
return prepareChatAddUserText(data);
|
||||||
|
@ -4255,6 +4290,8 @@ void HistoryItem::setServiceMessageByAction(const MTPmessageAction &action) {
|
||||||
return prepareRequestedPeer(data);
|
return prepareRequestedPeer(data);
|
||||||
}, [&](const MTPDmessageActionSetChatWallPaper &data) {
|
}, [&](const MTPDmessageActionSetChatWallPaper &data) {
|
||||||
return prepareSetChatWallPaper(data);
|
return prepareSetChatWallPaper(data);
|
||||||
|
}, [&](const MTPDmessageActionSetSameChatWallPaper &data) {
|
||||||
|
return prepareSetSameChatWallPaper(data);
|
||||||
}, [](const MTPDmessageActionEmpty &) {
|
}, [](const MTPDmessageActionEmpty &) {
|
||||||
return PreparedServiceText{ { tr::lng_message_empty(tr::now) } };
|
return PreparedServiceText{ { tr::lng_message_empty(tr::now) } };
|
||||||
}));
|
}));
|
||||||
|
|
|
@ -530,6 +530,11 @@ struct HistoryServicePayment
|
||||||
bool recurringUsed = false;
|
bool recurringUsed = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct HistoryServiceSameBackground
|
||||||
|
: public RuntimeComponent<HistoryServiceSameBackground, HistoryItem>
|
||||||
|
, public HistoryServiceDependentData {
|
||||||
|
};
|
||||||
|
|
||||||
enum class HistorySelfDestructType {
|
enum class HistorySelfDestructType {
|
||||||
Photo,
|
Photo,
|
||||||
Video,
|
Video,
|
||||||
|
|
|
@ -159,7 +159,7 @@ struct FilterRow {
|
||||||
const auto result = count
|
const auto result = count
|
||||||
? tr::lng_filters_chats_count(tr::now, lt_count_short, count)
|
? tr::lng_filters_chats_count(tr::now, lt_count_short, count)
|
||||||
: tr::lng_filters_no_chats(tr::now);
|
: tr::lng_filters_no_chats(tr::now);
|
||||||
return filter.community()
|
return filter.chatlist()
|
||||||
? result + QString::fromUtf8(" \xE2\x80\xA2 shareable folder")
|
? result + QString::fromUtf8(" \xE2\x80\xA2 shareable folder")
|
||||||
: result;
|
: result;
|
||||||
}
|
}
|
||||||
|
@ -371,7 +371,7 @@ void FilterRowButton::paintEvent(QPaintEvent *e) {
|
||||||
const auto row = find(button);
|
const auto row = find(button);
|
||||||
if (row->removed || row->removePeersRequestId > 0) {
|
if (row->removed || row->removePeersRequestId > 0) {
|
||||||
return;
|
return;
|
||||||
} else if (row->filter.community()
|
} else if (row->filter.chatlist()
|
||||||
&& !row->filter.always().empty()) {
|
&& !row->filter.always().empty()) {
|
||||||
const auto chosen = crl::guard(button, [=](
|
const auto chosen = crl::guard(button, [=](
|
||||||
std::vector<not_null<PeerData*>> peers) {
|
std::vector<not_null<PeerData*>> peers) {
|
||||||
|
@ -399,7 +399,7 @@ void FilterRowButton::paintEvent(QPaintEvent *e) {
|
||||||
const auto row = find(button);
|
const auto row = find(button);
|
||||||
if (row->removed || row->removePeersRequestId > 0) {
|
if (row->removed || row->removePeersRequestId > 0) {
|
||||||
return;
|
return;
|
||||||
} else if (row->filter.community() && row->removeHasLinks) {
|
} else if (row->filter.chatlist() && row->removeHasLinks) {
|
||||||
controller->show(Ui::MakeConfirmBox({
|
controller->show(Ui::MakeConfirmBox({
|
||||||
.text = { tr::lng_filters_delete_sure(tr::now) },
|
.text = { tr::lng_filters_delete_sure(tr::now) },
|
||||||
.confirmed = crl::guard(button, [=](Fn<void()> close) {
|
.confirmed = crl::guard(button, [=](Fn<void()> close) {
|
||||||
|
@ -417,10 +417,10 @@ void FilterRowButton::paintEvent(QPaintEvent *e) {
|
||||||
const auto row = find(button);
|
const auto row = find(button);
|
||||||
if (row->removed || row->removePeersRequestId > 0) {
|
if (row->removed || row->removePeersRequestId > 0) {
|
||||||
return;
|
return;
|
||||||
} else if (row->filter.community() && !row->removePeersRequestId) {
|
} else if (row->filter.chatlist() && !row->removePeersRequestId) {
|
||||||
row->removePeersRequestId = session->api().request(
|
row->removePeersRequestId = session->api().request(
|
||||||
MTPcommunities_GetLeaveCommunitySuggestions(
|
MTPchatlists_GetLeaveChatlistSuggestions(
|
||||||
MTP_inputCommunityDialogFilter(
|
MTP_inputChatlistDialogFilter(
|
||||||
MTP_int(row->filter.id())))
|
MTP_int(row->filter.id())))
|
||||||
).done(crl::guard(button, [=](const MTPVector<MTPPeer> &result) {
|
).done(crl::guard(button, [=](const MTPVector<MTPPeer> &result) {
|
||||||
const auto row = find(button);
|
const auto row = find(button);
|
||||||
|
@ -642,7 +642,7 @@ void FilterRowButton::paintEvent(QPaintEvent *e) {
|
||||||
auto updates = std::vector<MTPUpdate>();
|
auto updates = std::vector<MTPUpdate>();
|
||||||
auto addRequests = std::vector<MTPmessages_UpdateDialogFilter>();
|
auto addRequests = std::vector<MTPmessages_UpdateDialogFilter>();
|
||||||
auto removeRequests = std::vector<MTPmessages_UpdateDialogFilter>();
|
auto removeRequests = std::vector<MTPmessages_UpdateDialogFilter>();
|
||||||
auto removeCommunityRequests = std::vector<MTPcommunities_LeaveCommunity>();
|
auto removeChatlistRequests = std::vector<MTPchatlists_LeaveChatlist>();
|
||||||
|
|
||||||
auto &realFilters = session->data().chatsFilters();
|
auto &realFilters = session->data().chatsFilters();
|
||||||
const auto &list = realFilters.list();
|
const auto &list = realFilters.list();
|
||||||
|
@ -671,18 +671,18 @@ void FilterRowButton::paintEvent(QPaintEvent *e) {
|
||||||
const auto tl = removed
|
const auto tl = removed
|
||||||
? MTPDialogFilter()
|
? MTPDialogFilter()
|
||||||
: row.filter.tl(newId);
|
: row.filter.tl(newId);
|
||||||
const auto removeCommunityWithChats = removed
|
const auto removeChatlistWithChats = removed
|
||||||
&& row.filter.community()
|
&& row.filter.chatlist()
|
||||||
&& !row.removePeers.empty();
|
&& !row.removePeers.empty();
|
||||||
if (removeCommunityWithChats) {
|
if (removeChatlistWithChats) {
|
||||||
auto inputs = ranges::views::all(
|
auto inputs = ranges::views::all(
|
||||||
row.removePeers
|
row.removePeers
|
||||||
) | ranges::views::transform([](not_null<PeerData*> peer) {
|
) | ranges::views::transform([](not_null<PeerData*> peer) {
|
||||||
return MTPInputPeer(peer->input);
|
return MTPInputPeer(peer->input);
|
||||||
}) | ranges::to<QVector>();
|
}) | ranges::to<QVector>();
|
||||||
removeCommunityRequests.push_back(
|
removeChatlistRequests.push_back(
|
||||||
MTPcommunities_LeaveCommunity(
|
MTPchatlists_LeaveChatlist(
|
||||||
MTP_inputCommunityDialogFilter(MTP_int(newId)),
|
MTP_inputChatlistDialogFilter(MTP_int(newId)),
|
||||||
MTP_vector<MTPInputPeer>(std::move(inputs))));
|
MTP_vector<MTPInputPeer>(std::move(inputs))));
|
||||||
} else {
|
} else {
|
||||||
const auto request = MTPmessages_UpdateDialogFilter(
|
const auto request = MTPmessages_UpdateDialogFilter(
|
||||||
|
@ -726,7 +726,7 @@ void FilterRowButton::paintEvent(QPaintEvent *e) {
|
||||||
updates = std::move(updates),
|
updates = std::move(updates),
|
||||||
addRequests = std::move(addRequests),
|
addRequests = std::move(addRequests),
|
||||||
removeRequests = std::move(removeRequests),
|
removeRequests = std::move(removeRequests),
|
||||||
removeCommunityRequests = std::move(removeCommunityRequests)
|
removeChatlistRequests = std::move(removeChatlistRequests)
|
||||||
] {
|
] {
|
||||||
const auto api = &session->api();
|
const auto api = &session->api();
|
||||||
const auto filters = &session->data().chatsFilters();
|
const auto filters = &session->data().chatsFilters();
|
||||||
|
@ -760,7 +760,7 @@ void FilterRowButton::paintEvent(QPaintEvent *e) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
sendRequests(removeRequests);
|
sendRequests(removeRequests);
|
||||||
sendRequests(removeCommunityRequests);
|
sendRequests(removeChatlistRequests);
|
||||||
sendRequests(addRequests);
|
sendRequests(addRequests);
|
||||||
if (!order.empty() && !addRequests.empty()) {
|
if (!order.empty() && !addRequests.empty()) {
|
||||||
filters->saveOrder(order, previousId);
|
filters->saveOrder(order, previousId);
|
||||||
|
|
|
@ -644,6 +644,7 @@ void ChatBackground::checkUploadWallPaper() {
|
||||||
_wallPaperUploadId = FullMsgId();
|
_wallPaperUploadId = FullMsgId();
|
||||||
_wallPaperRequestId = _session->api().request(
|
_wallPaperRequestId = _session->api().request(
|
||||||
MTPaccount_UploadWallPaper(
|
MTPaccount_UploadWallPaper(
|
||||||
|
MTP_flags(0),
|
||||||
data.info.file,
|
data.info.file,
|
||||||
MTP_string("image/jpeg"),
|
MTP_string("image/jpeg"),
|
||||||
_paper.mtpSettings()
|
_paper.mtpSettings()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user