Update layer to 164.
This commit is contained in:
parent
a7e9980246
commit
153ff5503b
@ -63,7 +63,7 @@ inputMediaInvoice#8eb5a6d5 flags:# title:string description:string photo:flags.0
|
||||
inputMediaGeoLive#971fa843 flags:# stopped:flags.0?true geo_point:InputGeoPoint heading:flags.2?int period:flags.1?int proximity_notification_radius:flags.3?int = InputMedia;
|
||||
inputMediaPoll#f94e5f1 flags:# poll:Poll correct_answers:flags.0?Vector<bytes> solution:flags.1?string solution_entities:flags.1?Vector<MessageEntity> = InputMedia;
|
||||
inputMediaDice#e66fbf7b emoticon:string = InputMedia;
|
||||
inputMediaStory#9a86b58f user_id:InputUser id:int = InputMedia;
|
||||
inputMediaStory#89fdd778 peer:InputPeer id:int = InputMedia;
|
||||
|
||||
inputChatPhotoEmpty#1ca48f57 = InputChatPhoto;
|
||||
inputChatUploadedPhoto#bdcdaec0 flags:# file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double video_emoji_markup:flags.3?VideoSize = InputChatPhoto;
|
||||
@ -117,11 +117,11 @@ userStatusLastMonth#77ebc742 = UserStatus;
|
||||
chatEmpty#29562865 id:long = Chat;
|
||||
chat#41cbf256 flags:# creator:flags.0?true left:flags.2?true deactivated:flags.5?true call_active:flags.23?true call_not_empty:flags.24?true noforwards:flags.25?true id:long title:string photo:ChatPhoto participants_count:int date:int version:int migrated_to:flags.6?InputChannel admin_rights:flags.14?ChatAdminRights default_banned_rights:flags.18?ChatBannedRights = Chat;
|
||||
chatForbidden#6592a1a7 id:long title:string = Chat;
|
||||
channel#83259464 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 noforwards:flags.27?true join_to_send:flags.28?true join_request:flags.29?true forum:flags.30?true flags2:# 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 usernames:flags2.0?Vector<Username> = Chat;
|
||||
channel#94f592db 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 noforwards:flags.27?true join_to_send:flags.28?true join_request:flags.29?true forum:flags.30?true flags2:# stories_hidden:flags2.1?true stories_hidden_min:flags2.2?true stories_unavailable:flags2.3?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 usernames:flags2.0?Vector<Username> stories_max_id:flags2.4?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#c9d31138 flags:# can_set_username:flags.7?true has_scheduled:flags.8?true translations_disabled:flags.19?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> available_reactions:flags.18?ChatReactions = ChatFull;
|
||||
channelFull#f2355507 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 flags2:# can_delete_channel:flags2.0?true antispam:flags2.1?true participants_hidden:flags2.2?true translations_disabled:flags2.3?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> default_send_as:flags.29?Peer available_reactions:flags.30?ChatReactions = ChatFull;
|
||||
channelFull#723027bd 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 flags2:# can_delete_channel:flags2.0?true antispam:flags2.1?true participants_hidden:flags2.2?true translations_disabled:flags2.3?true stories_pinned_available:flags2.5?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> default_send_as:flags.29?Peer available_reactions:flags.30?ChatReactions stories:flags2.4?PeerStories = ChatFull;
|
||||
|
||||
chatParticipant#c02d4007 user_id:long inviter_id:long date:int = ChatParticipant;
|
||||
chatParticipantCreator#e46bcee4 user_id:long = ChatParticipant;
|
||||
@ -150,7 +150,7 @@ messageMediaInvoice#f6a548d3 flags:# shipping_address_requested:flags.1?true tes
|
||||
messageMediaGeoLive#b940c666 flags:# geo:GeoPoint heading:flags.0?int period:int proximity_notification_radius:flags.1?int = MessageMedia;
|
||||
messageMediaPoll#4bd6e798 poll:Poll results:PollResults = MessageMedia;
|
||||
messageMediaDice#3f7ee58b value:int emoticon:string = MessageMedia;
|
||||
messageMediaStory#cbb20d88 flags:# via_mention:flags.1?true user_id:long id:int story:flags.0?StoryItem = MessageMedia;
|
||||
messageMediaStory#68cb6283 flags:# via_mention:flags.1?true peer:Peer id:int story:flags.0?StoryItem = MessageMedia;
|
||||
|
||||
messageActionEmpty#b6aef7b0 = MessageAction;
|
||||
messageActionChatCreate#bd47cbad title:string users:Vector<long> = MessageAction;
|
||||
@ -242,7 +242,7 @@ inputReportReasonFake#f5ddd6e7 = ReportReason;
|
||||
inputReportReasonIllegalDrugs#a8eb2be = ReportReason;
|
||||
inputReportReasonPersonalDetails#9ec7863d = ReportReason;
|
||||
|
||||
userFull#4fe1cc86 flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true voice_messages_forbidden:flags.20?true translations_disabled:flags.23?true stories_pinned_available:flags.26?true blocked_my_stories_from:flags.27?true id:long about:flags.1?string settings:PeerSettings personal_photo:flags.21?Photo profile_photo:flags.2?Photo fallback_photo:flags.22?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int theme_emoticon:flags.15?string private_forward_name:flags.16?string bot_group_admin_rights:flags.17?ChatAdminRights bot_broadcast_admin_rights:flags.18?ChatAdminRights premium_gifts:flags.19?Vector<PremiumGiftOption> wallpaper:flags.24?WallPaper stories:flags.25?UserStories = UserFull;
|
||||
userFull#b9b12c6c flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true voice_messages_forbidden:flags.20?true translations_disabled:flags.23?true stories_pinned_available:flags.26?true blocked_my_stories_from:flags.27?true id:long about:flags.1?string settings:PeerSettings personal_photo:flags.21?Photo profile_photo:flags.2?Photo fallback_photo:flags.22?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int theme_emoticon:flags.15?string private_forward_name:flags.16?string bot_group_admin_rights:flags.17?ChatAdminRights bot_broadcast_admin_rights:flags.18?ChatAdminRights premium_gifts:flags.19?Vector<PremiumGiftOption> wallpaper:flags.24?WallPaper stories:flags.25?PeerStories = UserFull;
|
||||
|
||||
contact#145ade0b user_id:long mutual:Bool = Contact;
|
||||
|
||||
@ -404,11 +404,11 @@ updateChannelPinnedTopics#fe198602 flags:# channel_id:long order:flags.0?Vector<
|
||||
updateUser#20529438 user_id:long = Update;
|
||||
updateAutoSaveSettings#ec05b097 = Update;
|
||||
updateGroupInvitePrivacyForbidden#ccf08ad6 user_id:long = Update;
|
||||
updateStory#205a4133 user_id:long story:StoryItem = Update;
|
||||
updateReadStories#feb5345a user_id:long max_id:int = Update;
|
||||
updateStory#75b3b798 peer:Peer story:StoryItem = Update;
|
||||
updateReadStories#f74e932b peer:Peer max_id:int = Update;
|
||||
updateStoryID#1bf335b9 id:int random_id:long = Update;
|
||||
updateStoriesStealthMode#2c084dc1 stealth_mode:StoriesStealthMode = Update;
|
||||
updateSentStoryReaction#e3a73d20 user_id:long story_id:int reaction:Reaction = Update;
|
||||
updateSentStoryReaction#7d627683 peer:Peer story_id:int reaction:Reaction = Update;
|
||||
|
||||
updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;
|
||||
|
||||
@ -864,7 +864,7 @@ dataJSON#7d748d04 data:string = DataJSON;
|
||||
|
||||
labeledPrice#cb296bf8 label:string amount:long = LabeledPrice;
|
||||
|
||||
invoice#3e85a91b flags:# test:flags.0?true name_requested:flags.1?true phone_requested:flags.2?true email_requested:flags.3?true shipping_address_requested:flags.4?true flexible:flags.5?true phone_to_provider:flags.6?true email_to_provider:flags.7?true recurring:flags.9?true currency:string prices:Vector<LabeledPrice> max_tip_amount:flags.8?long suggested_tip_amounts:flags.8?Vector<long> recurring_terms_url:flags.9?string = Invoice;
|
||||
invoice#5db95a15 flags:# test:flags.0?true name_requested:flags.1?true phone_requested:flags.2?true email_requested:flags.3?true shipping_address_requested:flags.4?true flexible:flags.5?true phone_to_provider:flags.6?true email_to_provider:flags.7?true recurring:flags.9?true currency:string prices:Vector<LabeledPrice> max_tip_amount:flags.8?long suggested_tip_amounts:flags.8?Vector<long> terms_url:flags.10?string = Invoice;
|
||||
|
||||
paymentCharge#ea02c27e id:string provider_charge_id:string = PaymentCharge;
|
||||
|
||||
@ -1144,7 +1144,7 @@ chatOnlines#f041e250 onlines:int = ChatOnlines;
|
||||
|
||||
statsURL#47a971e0 url:string = StatsURL;
|
||||
|
||||
chatAdminRights#5fb224d5 flags:# change_info:flags.0?true post_messages:flags.1?true edit_messages:flags.2?true delete_messages:flags.3?true ban_users:flags.4?true invite_users:flags.5?true pin_messages:flags.7?true add_admins:flags.9?true anonymous:flags.10?true manage_call:flags.11?true other:flags.12?true manage_topics:flags.13?true = ChatAdminRights;
|
||||
chatAdminRights#5fb224d5 flags:# change_info:flags.0?true post_messages:flags.1?true edit_messages:flags.2?true delete_messages:flags.3?true ban_users:flags.4?true invite_users:flags.5?true pin_messages:flags.7?true add_admins:flags.9?true anonymous:flags.10?true manage_call:flags.11?true other:flags.12?true manage_topics:flags.13?true post_stories:flags.14?true edit_stories:flags.15?true delete_stories:flags.16?true = ChatAdminRights;
|
||||
|
||||
chatBannedRights#9f120418 flags:# view_messages:flags.0?true send_messages:flags.1?true send_media:flags.2?true send_stickers:flags.3?true send_gifs:flags.4?true send_games:flags.5?true send_inline:flags.6?true embed_links:flags.7?true send_polls:flags.8?true change_info:flags.10?true invite_users:flags.15?true pin_messages:flags.17?true manage_topics:flags.18?true send_photos:flags.19?true send_videos:flags.20?true send_roundvideos:flags.21?true send_audios:flags.22?true send_voices:flags.23?true send_docs:flags.24?true send_plain:flags.25?true until_date:int = ChatBannedRights;
|
||||
|
||||
@ -1219,7 +1219,7 @@ inputThemeSettings#8fde504f flags:# message_colors_animated:flags.2?true base_th
|
||||
themeSettings#fa58b6d4 flags:# message_colors_animated:flags.2?true base_theme:BaseTheme accent_color:int outbox_accent_color:flags.3?int message_colors:flags.0?Vector<int> wallpaper:flags.1?WallPaper = ThemeSettings;
|
||||
|
||||
webPageAttributeTheme#54b56617 flags:# documents:flags.0?Vector<Document> settings:flags.1?ThemeSettings = WebPageAttribute;
|
||||
webPageAttributeStory#939a4671 flags:# user_id:long id:int story:flags.0?StoryItem = WebPageAttribute;
|
||||
webPageAttributeStory#2e94c3e7 flags:# peer:Peer id:int story:flags.0?StoryItem = WebPageAttribute;
|
||||
|
||||
messages.votesList#4899484e flags:# count:int votes:Vector<MessagePeerVote> chats:Vector<Chat> users:Vector<User> next_offset:flags.0?string = messages.VotesList;
|
||||
|
||||
@ -1550,20 +1550,16 @@ messagePeerVoteMultiple#4628f6e6 peer:Peer options:Vector<bytes> date:int = Mess
|
||||
|
||||
sponsoredWebPage#3db8ec63 flags:# url:string site_name:string photo:flags.0?Photo = SponsoredWebPage;
|
||||
|
||||
storyViews#c64c0b97 flags:# has_viewers:flags.1?true views_count:int reactions_count:int recent_viewers:flags.0?Vector<long> = StoryViews;
|
||||
storyViews#8d595cd6 flags:# has_viewers:flags.1?true views_count:int forwards_count:flags.2?int reactions:flags.3?Vector<ReactionCount> reactions_count:flags.4?int recent_viewers:flags.0?Vector<long> = StoryViews;
|
||||
|
||||
storyItemDeleted#51e6ee4f id:int = StoryItem;
|
||||
storyItemSkipped#ffadc913 flags:# close_friends:flags.8?true id:int date:int expire_date:int = StoryItem;
|
||||
storyItem#44c457ce flags:# pinned:flags.5?true public:flags.7?true close_friends:flags.8?true min:flags.9?true noforwards:flags.10?true edited:flags.11?true contacts:flags.12?true selected_contacts:flags.13?true id:int date:int expire_date:int caption:flags.0?string entities:flags.1?Vector<MessageEntity> media:MessageMedia media_areas:flags.14?Vector<MediaArea> privacy:flags.2?Vector<PrivacyRule> views:flags.3?StoryViews sent_reaction:flags.15?Reaction = StoryItem;
|
||||
|
||||
userStories#8611a200 flags:# user_id:long max_read_id:flags.0?int stories:Vector<StoryItem> = UserStories;
|
||||
storyItem#44c457ce flags:# pinned:flags.5?true public:flags.7?true close_friends:flags.8?true min:flags.9?true noforwards:flags.10?true edited:flags.11?true contacts:flags.12?true selected_contacts:flags.13?true out:flags.16?true id:int date:int expire_date:int caption:flags.0?string entities:flags.1?Vector<MessageEntity> media:MessageMedia media_areas:flags.14?Vector<MediaArea> privacy:flags.2?Vector<PrivacyRule> views:flags.3?StoryViews sent_reaction:flags.15?Reaction = StoryItem;
|
||||
|
||||
stories.allStoriesNotModified#1158fe3e flags:# state:string stealth_mode:StoriesStealthMode = stories.AllStories;
|
||||
stories.allStories#519d899e flags:# has_more:flags.0?true count:int state:string user_stories:Vector<UserStories> users:Vector<User> stealth_mode:StoriesStealthMode = stories.AllStories;
|
||||
stories.allStories#6efc5e81 flags:# has_more:flags.0?true count:int state:string peer_stories:Vector<PeerStories> chats:Vector<Chat> users:Vector<User> stealth_mode:StoriesStealthMode = stories.AllStories;
|
||||
|
||||
stories.stories#4fe57df1 count:int stories:Vector<StoryItem> users:Vector<User> = stories.Stories;
|
||||
|
||||
stories.userStories#37a6ff5f stories:UserStories users:Vector<User> = stories.UserStories;
|
||||
stories.stories#5dd8c3c8 count:int stories:Vector<StoryItem> chats:Vector<Chat> users:Vector<User> = stories.Stories;
|
||||
|
||||
storyView#b0bdeac5 flags:# blocked:flags.0?true blocked_my_stories_from:flags.1?true user_id:long date:int reaction:flags.2?Reaction = StoryView;
|
||||
|
||||
@ -1583,6 +1579,20 @@ mediaAreaCoordinates#3d1ea4e x:double y:double w:double h:double rotation:double
|
||||
mediaAreaVenue#be82db9c coordinates:MediaAreaCoordinates geo:GeoPoint title:string address:string provider:string venue_id:string venue_type:string = MediaArea;
|
||||
inputMediaAreaVenue#b282217f coordinates:MediaAreaCoordinates query_id:long result_id:string = MediaArea;
|
||||
mediaAreaGeoPoint#df8b3b22 coordinates:MediaAreaCoordinates geo:GeoPoint = MediaArea;
|
||||
mediaAreaSuggestedReaction#14455871 flags:# dark:flags.0?true flipped:flags.1?true coordinates:MediaAreaCoordinates reaction:Reaction = MediaArea;
|
||||
|
||||
peerStories#9a35e999 flags:# peer:Peer max_read_id:flags.0?int stories:Vector<StoryItem> = PeerStories;
|
||||
|
||||
stories.peerStories#cae68768 stories:PeerStories chats:Vector<Chat> users:Vector<User> = stories.PeerStories;
|
||||
|
||||
stories.boostsStatus#66ea1fef flags:# my_boost:flags.2?true level:int current_level_boosts:int boosts:int next_level_boosts:flags.0?int premium_audience:flags.1?StatsPercentValue = stories.BoostsStatus;
|
||||
|
||||
stories.canApplyBoostOk#c3173587 = stories.CanApplyBoostResult;
|
||||
stories.canApplyBoostReplace#712c4655 current_boost:Peer chats:Vector<Chat> = stories.CanApplyBoostResult;
|
||||
|
||||
booster#e9e6380 user_id:long expires:int = Booster;
|
||||
|
||||
stories.boostersList#f3dd3d1d flags:# count:int boosters:Vector<Booster> next_offset:flags.0?string users:Vector<User> = stories.BoostersList;
|
||||
|
||||
---functions---
|
||||
|
||||
@ -1709,7 +1719,6 @@ account.invalidateSignInCodes#ca8ae8ba codes:Vector<string> = Bool;
|
||||
users.getUsers#d91a548 id:Vector<InputUser> = Vector<User>;
|
||||
users.getFullUser#b60f5918 id:InputUser = users.UserFull;
|
||||
users.setSecureValueErrors#90c894b5 id:InputUser errors:Vector<SecureValueError> = Bool;
|
||||
users.getStoriesMaxIDs#ca1cb9ab id:Vector<InputUser> = Vector<int>;
|
||||
|
||||
contacts.getContactIDs#7adc669d hash:long = Vector<int>;
|
||||
contacts.getStatuses#c4a353ee = Vector<ContactStatus>;
|
||||
@ -1735,7 +1744,6 @@ contacts.resolvePhone#8af94344 phone:string = contacts.ResolvedPeer;
|
||||
contacts.exportContactToken#f8654027 = ExportedContactToken;
|
||||
contacts.importContactToken#13005788 token:string = User;
|
||||
contacts.editCloseFriends#ba6705f0 id:Vector<long> = Bool;
|
||||
contacts.toggleStoriesHidden#753fb865 id:InputUser hidden:Bool = Bool;
|
||||
contacts.setBlocked#94c65c76 flags:# my_stories_from:flags.0?true id:Vector<InputPeer> limit:int = Bool;
|
||||
|
||||
messages.getMessages#63c66506 id:Vector<InputMessage> = messages.Messages;
|
||||
@ -2124,23 +2132,30 @@ chatlists.hideChatlistUpdates#66e486fb chatlist:InputChatlist = Bool;
|
||||
chatlists.getLeaveChatlistSuggestions#fdbcd714 chatlist:InputChatlist = Vector<Peer>;
|
||||
chatlists.leaveChatlist#74fae13a chatlist:InputChatlist peers:Vector<InputPeer> = Updates;
|
||||
|
||||
stories.canSendStory#b100d45d = Bool;
|
||||
stories.sendStory#d455fcec flags:# pinned:flags.2?true noforwards:flags.4?true media:InputMedia media_areas:flags.5?Vector<MediaArea> caption:flags.0?string entities:flags.1?Vector<MessageEntity> privacy_rules:Vector<InputPrivacyRule> random_id:long period:flags.3?int = Updates;
|
||||
stories.editStory#a9b91ae4 flags:# id:int media:flags.0?InputMedia media_areas:flags.3?Vector<MediaArea> caption:flags.1?string entities:flags.1?Vector<MessageEntity> privacy_rules:flags.2?Vector<InputPrivacyRule> = Updates;
|
||||
stories.deleteStories#b5d501d7 id:Vector<int> = Vector<int>;
|
||||
stories.togglePinned#51602944 id:Vector<int> pinned:Bool = Vector<int>;
|
||||
stories.canSendStory#c7dfdfdd peer:InputPeer = Bool;
|
||||
stories.sendStory#bcb73644 flags:# pinned:flags.2?true noforwards:flags.4?true peer:InputPeer media:InputMedia media_areas:flags.5?Vector<MediaArea> caption:flags.0?string entities:flags.1?Vector<MessageEntity> privacy_rules:Vector<InputPrivacyRule> random_id:long period:flags.3?int = Updates;
|
||||
stories.editStory#b583ba46 flags:# peer:InputPeer id:int media:flags.0?InputMedia media_areas:flags.3?Vector<MediaArea> caption:flags.1?string entities:flags.1?Vector<MessageEntity> privacy_rules:flags.2?Vector<InputPrivacyRule> = Updates;
|
||||
stories.deleteStories#ae59db5f peer:InputPeer id:Vector<int> = Vector<int>;
|
||||
stories.togglePinned#9a75a1ef peer:InputPeer id:Vector<int> pinned:Bool = Vector<int>;
|
||||
stories.getAllStories#eeb0d625 flags:# next:flags.1?true hidden:flags.2?true state:flags.0?string = stories.AllStories;
|
||||
stories.getUserStories#96d528e0 user_id:InputUser = stories.UserStories;
|
||||
stories.getPinnedStories#b471137 user_id:InputUser offset_id:int limit:int = stories.Stories;
|
||||
stories.getStoriesArchive#1f5bc5d2 offset_id:int limit:int = stories.Stories;
|
||||
stories.getStoriesByID#6a15cf46 user_id:InputUser id:Vector<int> = stories.Stories;
|
||||
stories.getPinnedStories#5821a5dc peer:InputPeer offset_id:int limit:int = stories.Stories;
|
||||
stories.getStoriesArchive#b4352016 peer:InputPeer offset_id:int limit:int = stories.Stories;
|
||||
stories.getStoriesByID#5774ca74 peer:InputPeer id:Vector<int> = stories.Stories;
|
||||
stories.toggleAllStoriesHidden#7c2557c4 hidden:Bool = Bool;
|
||||
stories.getAllReadUserStories#729c562c = Updates;
|
||||
stories.readStories#edc5105b user_id:InputUser max_id:int = Vector<int>;
|
||||
stories.incrementStoryViews#22126127 user_id:InputUser id:Vector<int> = Bool;
|
||||
stories.getStoryViewsList#f95f61a4 flags:# just_contacts:flags.0?true reactions_first:flags.2?true q:flags.1?string id:int offset:string limit:int = stories.StoryViewsList;
|
||||
stories.getStoriesViews#9a75d6a6 id:Vector<int> = stories.StoryViews;
|
||||
stories.exportStoryLink#16e443ce user_id:InputUser id:int = ExportedStoryLink;
|
||||
stories.report#c95be06a user_id:InputUser id:Vector<int> reason:ReportReason message:string = Bool;
|
||||
stories.readStories#a556dac8 peer:InputPeer max_id:int = Vector<int>;
|
||||
stories.incrementStoryViews#b2028afb peer:InputPeer id:Vector<int> = Bool;
|
||||
stories.getStoryViewsList#7ed23c57 flags:# just_contacts:flags.0?true reactions_first:flags.2?true peer:InputPeer q:flags.1?string id:int offset:string limit:int = stories.StoryViewsList;
|
||||
stories.getStoriesViews#28e16cc8 peer:InputPeer id:Vector<int> = stories.StoryViews;
|
||||
stories.exportStoryLink#7b8def20 peer:InputPeer id:int = ExportedStoryLink;
|
||||
stories.report#1923fa8c peer:InputPeer id:Vector<int> reason:ReportReason message:string = Bool;
|
||||
stories.activateStealthMode#57bbd166 flags:# past:flags.0?true future:flags.1?true = Updates;
|
||||
stories.sendReaction#49aaa9b3 flags:# add_to_recent:flags.0?true user_id:InputUser story_id:int reaction:Reaction = Updates;
|
||||
stories.sendReaction#7fd736b2 flags:# add_to_recent:flags.0?true peer:InputPeer story_id:int reaction:Reaction = Updates;
|
||||
stories.getPeerStories#2c4ada50 peer:InputPeer = stories.PeerStories;
|
||||
stories.getAllReadPeerStories#9b5ae7f9 = Updates;
|
||||
stories.getPeerMaxIDs#535983c3 id:Vector<InputPeer> = Vector<int>;
|
||||
stories.getChatsToSend#a56a8b60 = messages.Chats;
|
||||
stories.togglePeerStoriesHidden#bd0415c4 peer:InputPeer hidden:Bool = Bool;
|
||||
stories.getBoostsStatus#4c449472 peer:InputPeer = stories.BoostsStatus;
|
||||
stories.getBoostersList#337ef980 peer:InputPeer offset:string limit:int = stories.BoostersList;
|
||||
stories.canApplyBoost#db05c1bd peer:InputPeer = stories.CanApplyBoostResult;
|
||||
stories.applyBoost#f29d7c2b peer:InputPeer = Bool;
|
||||
|
@ -3797,13 +3797,13 @@ class GetStoriesMaxIdsQuery final : public Td::ResultHandler {
|
||||
vector<UserId> user_ids_;
|
||||
|
||||
public:
|
||||
void send(vector<UserId> user_ids, vector<telegram_api::object_ptr<telegram_api::InputUser>> &&input_users) {
|
||||
void send(vector<UserId> user_ids, vector<telegram_api::object_ptr<telegram_api::InputPeer>> &&input_peers) {
|
||||
user_ids_ = std::move(user_ids);
|
||||
send_query(G()->net_query_creator().create(telegram_api::users_getStoriesMaxIDs(std::move(input_users))));
|
||||
send_query(G()->net_query_creator().create(telegram_api::stories_getPeerMaxIDs(std::move(input_peers))));
|
||||
}
|
||||
|
||||
void on_result(BufferSlice packet) final {
|
||||
auto result_ptr = fetch_result<telegram_api::users_getStoriesMaxIDs>(packet);
|
||||
auto result_ptr = fetch_result<telegram_api::stories_getPeerMaxIDs>(packet);
|
||||
if (result_ptr.is_error()) {
|
||||
return on_error(result_ptr.move_as_error());
|
||||
}
|
||||
@ -12683,7 +12683,7 @@ void ContactsManager::on_get_user_full(tl_object_ptr<telegram_api::userFull> &&u
|
||||
|
||||
td_->messages_manager_->on_update_dialog_is_translatable(DialogId(user_id), !user->translations_disabled_);
|
||||
|
||||
send_closure_later(td_->story_manager_actor_, &StoryManager::on_get_user_stories, DialogId(user_id),
|
||||
send_closure_later(td_->story_manager_actor_, &StoryManager::on_get_dialog_stories, DialogId(user_id),
|
||||
std::move(user->stories_), Promise<Unit>());
|
||||
|
||||
UserFull *user_full = add_user_full(user_id);
|
||||
@ -15594,28 +15594,31 @@ void ContactsManager::on_view_user_active_stories(vector<UserId> user_ids) {
|
||||
|
||||
const size_t MAX_SLICE_SIZE = 100; // server side limit
|
||||
vector<UserId> input_user_ids;
|
||||
vector<telegram_api::object_ptr<telegram_api::InputUser>> input_users;
|
||||
vector<telegram_api::object_ptr<telegram_api::InputPeer>> input_peers;
|
||||
for (auto &user_id : user_ids) {
|
||||
if (td::contains(input_user_ids, user_id)) {
|
||||
continue;
|
||||
}
|
||||
User *u = get_user(user_id);
|
||||
if (!need_poll_active_stories(u, user_id) || Time::now() < u->max_active_story_id_next_reload_time ||
|
||||
u->is_max_active_story_id_being_reloaded) {
|
||||
continue;
|
||||
}
|
||||
auto r_input_user = get_input_user(user_id);
|
||||
if (r_input_user.is_error() || td::contains(input_user_ids, user_id)) {
|
||||
auto input_peer = td_->messages_manager_->get_input_peer(DialogId(user_id), AccessRights::Read);
|
||||
if (input_peer == nullptr) {
|
||||
continue;
|
||||
}
|
||||
u->is_max_active_story_id_being_reloaded = true;
|
||||
input_user_ids.push_back(user_id);
|
||||
input_users.push_back(r_input_user.move_as_ok());
|
||||
if (input_users.size() == MAX_SLICE_SIZE) {
|
||||
td_->create_handler<GetStoriesMaxIdsQuery>()->send(std::move(input_user_ids), std::move(input_users));
|
||||
input_peers.push_back(std::move(input_peer));
|
||||
if (input_peers.size() == MAX_SLICE_SIZE) {
|
||||
td_->create_handler<GetStoriesMaxIdsQuery>()->send(std::move(input_user_ids), std::move(input_peers));
|
||||
input_user_ids.clear();
|
||||
input_users.clear();
|
||||
input_peers.clear();
|
||||
}
|
||||
}
|
||||
if (!input_users.empty()) {
|
||||
td_->create_handler<GetStoriesMaxIdsQuery>()->send(std::move(input_user_ids), std::move(input_users));
|
||||
if (!input_peers.empty()) {
|
||||
td_->create_handler<GetStoriesMaxIdsQuery>()->send(std::move(input_user_ids), std::move(input_peers));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -127,7 +127,7 @@ telegram_api::object_ptr<telegram_api::chatAdminRights> AdministratorRights::get
|
||||
return telegram_api::make_object<telegram_api::chatAdminRights>(
|
||||
flags, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/,
|
||||
false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/,
|
||||
false /*ignored*/);
|
||||
false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/);
|
||||
}
|
||||
|
||||
td_api::object_ptr<td_api::chatAdministratorRights> AdministratorRights::get_chat_administrator_rights_object() const {
|
||||
|
@ -268,7 +268,8 @@ tl_object_ptr<telegram_api::invoice> InputInvoice::Invoice::get_input_invoice()
|
||||
flags |= telegram_api::invoice::MAX_TIP_AMOUNT_MASK;
|
||||
}
|
||||
if (!recurring_payment_terms_of_service_url_.empty()) {
|
||||
flags |= telegram_api::invoice::RECURRING_TERMS_URL_MASK;
|
||||
flags |= telegram_api::invoice::RECURRING_MASK;
|
||||
flags |= telegram_api::invoice::TERMS_URL_MASK;
|
||||
}
|
||||
|
||||
auto prices = transform(price_parts_, [](const LabeledPricePart &price) {
|
||||
|
@ -39,6 +39,9 @@ MediaArea::MediaArea(Td *td, telegram_api::object_ptr<telegram_api::MediaArea> &
|
||||
}
|
||||
break;
|
||||
}
|
||||
case telegram_api::mediaAreaSuggestedReaction::ID:
|
||||
// TODO
|
||||
break;
|
||||
case telegram_api::inputMediaAreaVenue::ID:
|
||||
LOG(ERROR) << "Receive " << to_string(media_area_ptr);
|
||||
break;
|
||||
|
@ -2302,15 +2302,14 @@ static Result<InputMessageContent> create_input_message_content(
|
||||
DialogId story_sender_dialog_id(input_story->story_sender_chat_id_);
|
||||
StoryId story_id(input_story->story_id_);
|
||||
StoryFullId story_full_id(story_sender_dialog_id, story_id);
|
||||
if (!td->story_manager_->have_story_force(story_full_id) ||
|
||||
story_sender_dialog_id.get_type() != DialogType::User) {
|
||||
if (!td->story_manager_->have_story_force(story_full_id)) {
|
||||
return Status::Error(400, "Story not found");
|
||||
}
|
||||
if (!story_id.is_server()) {
|
||||
return Status::Error(400, "Story can't be forwarded");
|
||||
}
|
||||
if (td->contacts_manager_->get_input_user(story_sender_dialog_id.get_user_id()).is_error()) {
|
||||
return Status::Error(400, "Can't access the user");
|
||||
if (td->messages_manager_->get_input_peer(dialog_id, AccessRights::Read) == nullptr) {
|
||||
return Status::Error(400, "Can't access the story");
|
||||
}
|
||||
content = make_unique<MessageStory>(story_full_id, false);
|
||||
break;
|
||||
@ -5077,7 +5076,7 @@ unique_ptr<MessageContent> get_message_content(Td *td, FormattedText message,
|
||||
}
|
||||
case telegram_api::messageMediaStory::ID: {
|
||||
auto media = move_tl_object_as<telegram_api::messageMediaStory>(media_ptr);
|
||||
auto dialog_id = DialogId(UserId(media->user_id_));
|
||||
auto dialog_id = DialogId(media->peer_);
|
||||
auto story_id = StoryId(media->id_);
|
||||
auto story_full_id = StoryFullId(dialog_id, story_id);
|
||||
if (!story_full_id.is_server()) {
|
||||
|
@ -193,11 +193,15 @@ static tl_object_ptr<td_api::invoice> convert_invoice(tl_object_ptr<telegram_api
|
||||
invoice->suggested_tip_amounts_.resize(4);
|
||||
}
|
||||
|
||||
string recurring_terms_url;
|
||||
if (invoice->recurring_) {
|
||||
recurring_terms_url = std::move(invoice->terms_url_);
|
||||
}
|
||||
return make_tl_object<td_api::invoice>(std::move(invoice->currency_), std::move(labeled_prices),
|
||||
invoice->max_tip_amount_, std::move(invoice->suggested_tip_amounts_),
|
||||
std::move(invoice->recurring_terms_url_), is_test, need_name,
|
||||
need_phone_number, need_email_address, need_shipping_address,
|
||||
send_phone_number_to_provider, send_email_address_to_provider, is_flexible);
|
||||
recurring_terms_url, is_test, need_name, need_phone_number, need_email_address,
|
||||
need_shipping_address, send_phone_number_to_provider,
|
||||
send_email_address_to_provider, is_flexible);
|
||||
}
|
||||
|
||||
static tl_object_ptr<td_api::PaymentProvider> convert_payment_provider(
|
||||
|
@ -34,7 +34,6 @@
|
||||
#include "td/telegram/TdDb.h"
|
||||
#include "td/telegram/telegram_api.h"
|
||||
#include "td/telegram/UpdatesManager.h"
|
||||
#include "td/telegram/UserId.h"
|
||||
#include "td/telegram/WebPagesManager.h"
|
||||
|
||||
#include "td/db/binlog/BinlogEvent.h"
|
||||
@ -132,26 +131,26 @@ class GetAllStoriesQuery final : public Td::ResultHandler {
|
||||
|
||||
class ToggleStoriesHiddenQuery final : public Td::ResultHandler {
|
||||
Promise<Unit> promise_;
|
||||
UserId user_id_;
|
||||
DialogId dialog_id_;
|
||||
bool are_hidden_ = false;
|
||||
|
||||
public:
|
||||
explicit ToggleStoriesHiddenQuery(Promise<Unit> &&promise) : promise_(std::move(promise)) {
|
||||
}
|
||||
|
||||
void send(UserId user_id, bool are_hidden) {
|
||||
user_id_ = user_id;
|
||||
void send(DialogId dialog_id, bool are_hidden) {
|
||||
dialog_id_ = dialog_id;
|
||||
are_hidden_ = are_hidden;
|
||||
auto r_input_user = td_->contacts_manager_->get_input_user(user_id_);
|
||||
if (r_input_user.is_error()) {
|
||||
return on_error(r_input_user.move_as_error());
|
||||
auto input_peer = td_->messages_manager_->get_input_peer(dialog_id_, AccessRights::Read);
|
||||
if (input_peer == nullptr) {
|
||||
return on_error(Status::Error(400, "Can't access the chat"));
|
||||
}
|
||||
send_query(G()->net_query_creator().create(
|
||||
telegram_api::contacts_toggleStoriesHidden(r_input_user.move_as_ok(), are_hidden), {{user_id}}));
|
||||
telegram_api::stories_togglePeerStoriesHidden(std::move(input_peer), are_hidden), {{dialog_id_}}));
|
||||
}
|
||||
|
||||
void on_result(BufferSlice packet) final {
|
||||
auto result_ptr = fetch_result<telegram_api::contacts_toggleStoriesHidden>(packet);
|
||||
auto result_ptr = fetch_result<telegram_api::stories_togglePeerStoriesHidden>(packet);
|
||||
if (result_ptr.is_error()) {
|
||||
return on_error(result_ptr.move_as_error());
|
||||
}
|
||||
@ -159,35 +158,36 @@ class ToggleStoriesHiddenQuery final : public Td::ResultHandler {
|
||||
auto result = result_ptr.move_as_ok();
|
||||
LOG(DEBUG) << "Receive result for ToggleStoriesHiddenQuery: " << result;
|
||||
if (result) {
|
||||
td_->story_manager_->on_update_dialog_stories_hidden(DialogId(user_id_), are_hidden_);
|
||||
td_->story_manager_->on_update_dialog_stories_hidden(dialog_id_, are_hidden_);
|
||||
}
|
||||
promise_.set_value(Unit());
|
||||
}
|
||||
|
||||
void on_error(Status status) final {
|
||||
td_->messages_manager_->on_get_dialog_error(dialog_id_, status, "ToggleStoriesHiddenQuery");
|
||||
promise_.set_error(std::move(status));
|
||||
}
|
||||
};
|
||||
|
||||
class GetAllReadUserStoriesQuery final : public Td::ResultHandler {
|
||||
class GetAllReadPeerStoriesQuery final : public Td::ResultHandler {
|
||||
public:
|
||||
void send() {
|
||||
send_query(G()->net_query_creator().create(telegram_api::stories_getAllReadUserStories()));
|
||||
send_query(G()->net_query_creator().create(telegram_api::stories_getAllReadPeerStories()));
|
||||
}
|
||||
|
||||
void on_result(BufferSlice packet) final {
|
||||
auto result_ptr = fetch_result<telegram_api::stories_getAllReadUserStories>(packet);
|
||||
auto result_ptr = fetch_result<telegram_api::stories_getAllReadPeerStories>(packet);
|
||||
if (result_ptr.is_error()) {
|
||||
return on_error(result_ptr.move_as_error());
|
||||
}
|
||||
|
||||
auto ptr = result_ptr.move_as_ok();
|
||||
LOG(DEBUG) << "Receive result for GetAllReadUserStoriesQuery: " << to_string(ptr);
|
||||
LOG(DEBUG) << "Receive result for GetAllReadPeerStoriesQuery: " << to_string(ptr);
|
||||
td_->updates_manager_->on_get_updates(std::move(ptr), Promise<Unit>());
|
||||
}
|
||||
|
||||
void on_error(Status status) final {
|
||||
LOG(INFO) << "Receive error for GetAllReadUserStoriesQuery: " << status;
|
||||
LOG(INFO) << "Receive error for GetAllReadPeerStoriesQuery: " << status;
|
||||
}
|
||||
};
|
||||
|
||||
@ -221,19 +221,20 @@ class ToggleAllStoriesHiddenQuery final : public Td::ResultHandler {
|
||||
|
||||
class IncrementStoryViewsQuery final : public Td::ResultHandler {
|
||||
Promise<Unit> promise_;
|
||||
DialogId dialog_id_;
|
||||
|
||||
public:
|
||||
explicit IncrementStoryViewsQuery(Promise<Unit> &&promise) : promise_(std::move(promise)) {
|
||||
}
|
||||
|
||||
void send(DialogId owner_dialog_id, const vector<StoryId> &story_ids) {
|
||||
CHECK(owner_dialog_id.get_type() == DialogType::User);
|
||||
auto r_input_user = td_->contacts_manager_->get_input_user(owner_dialog_id.get_user_id());
|
||||
if (r_input_user.is_error()) {
|
||||
return on_error(r_input_user.move_as_error());
|
||||
void send(DialogId dialog_id, const vector<StoryId> &story_ids) {
|
||||
dialog_id_ = dialog_id;
|
||||
auto input_peer = td_->messages_manager_->get_input_peer(dialog_id_, AccessRights::Read);
|
||||
if (input_peer == nullptr) {
|
||||
return on_error(Status::Error(400, "Can't access the chat"));
|
||||
}
|
||||
send_query(G()->net_query_creator().create(
|
||||
telegram_api::stories_incrementStoryViews(r_input_user.move_as_ok(), StoryId::get_input_story_ids(story_ids)),
|
||||
telegram_api::stories_incrementStoryViews(std::move(input_peer), StoryId::get_input_story_ids(story_ids)),
|
||||
{{"view_story"}}));
|
||||
}
|
||||
|
||||
@ -247,25 +248,27 @@ class IncrementStoryViewsQuery final : public Td::ResultHandler {
|
||||
}
|
||||
|
||||
void on_error(Status status) final {
|
||||
td_->messages_manager_->on_get_dialog_error(dialog_id_, status, "IncrementStoryViewsQuery");
|
||||
promise_.set_error(std::move(status));
|
||||
}
|
||||
};
|
||||
|
||||
class ReadStoriesQuery final : public Td::ResultHandler {
|
||||
Promise<Unit> promise_;
|
||||
DialogId dialog_id_;
|
||||
|
||||
public:
|
||||
explicit ReadStoriesQuery(Promise<Unit> &&promise) : promise_(std::move(promise)) {
|
||||
}
|
||||
|
||||
void send(DialogId owner_dialog_id, StoryId max_read_story_id) {
|
||||
CHECK(owner_dialog_id.get_type() == DialogType::User);
|
||||
auto r_input_user = td_->contacts_manager_->get_input_user(owner_dialog_id.get_user_id());
|
||||
if (r_input_user.is_error()) {
|
||||
return on_error(r_input_user.move_as_error());
|
||||
void send(DialogId dialog_id, StoryId max_read_story_id) {
|
||||
dialog_id_ = dialog_id;
|
||||
auto input_peer = td_->messages_manager_->get_input_peer(dialog_id_, AccessRights::Read);
|
||||
if (input_peer == nullptr) {
|
||||
return on_error(Status::Error(400, "Can't access the chat"));
|
||||
}
|
||||
send_query(G()->net_query_creator().create(
|
||||
telegram_api::stories_readStories(r_input_user.move_as_ok(), max_read_story_id.get()), {{"view_story"}}));
|
||||
telegram_api::stories_readStories(std::move(input_peer), max_read_story_id.get()), {{"view_story"}}));
|
||||
}
|
||||
|
||||
void on_result(BufferSlice packet) final {
|
||||
@ -278,6 +281,7 @@ class ReadStoriesQuery final : public Td::ResultHandler {
|
||||
}
|
||||
|
||||
void on_error(Status status) final {
|
||||
td_->messages_manager_->on_get_dialog_error(dialog_id_, status, "ReadStoriesQuery");
|
||||
promise_.set_error(std::move(status));
|
||||
}
|
||||
};
|
||||
@ -293,13 +297,10 @@ class SendStoryReactionQuery final : public Td::ResultHandler {
|
||||
void send(StoryFullId story_full_id, const ReactionType &reaction_type, bool add_to_recent) {
|
||||
dialog_id_ = story_full_id.get_dialog_id();
|
||||
|
||||
CHECK(dialog_id_.get_type() == DialogType::User);
|
||||
auto r_input_user = td_->contacts_manager_->get_input_user(dialog_id_.get_user_id());
|
||||
if (r_input_user.is_error()) {
|
||||
return on_error(r_input_user.move_as_error());
|
||||
auto input_peer = td_->messages_manager_->get_input_peer(dialog_id_, AccessRights::Read);
|
||||
if (input_peer == nullptr) {
|
||||
return on_error(Status::Error(400, "Can't access the chat"));
|
||||
}
|
||||
// auto input_peer = td_->stories_manager_->get_input_peer(dialog_id_, AccessRights::Read);
|
||||
// CHECK(input_peer != nullptr);
|
||||
|
||||
int32 flags = 0;
|
||||
if (!reaction_type.is_empty() && add_to_recent) {
|
||||
@ -307,7 +308,7 @@ class SendStoryReactionQuery final : public Td::ResultHandler {
|
||||
}
|
||||
|
||||
send_query(G()->net_query_creator().create(
|
||||
telegram_api::stories_sendReaction(flags, false /*ignored*/, r_input_user.move_as_ok(),
|
||||
telegram_api::stories_sendReaction(flags, false /*ignored*/, std::move(input_peer),
|
||||
story_full_id.get_story_id().get(), reaction_type.get_input_reaction()),
|
||||
{{story_full_id}, {"view_story"}}));
|
||||
}
|
||||
@ -334,14 +335,21 @@ class SendStoryReactionQuery final : public Td::ResultHandler {
|
||||
|
||||
class GetStoryViewsListQuery final : public Td::ResultHandler {
|
||||
Promise<telegram_api::object_ptr<telegram_api::stories_storyViewsList>> promise_;
|
||||
DialogId dialog_id_;
|
||||
|
||||
public:
|
||||
explicit GetStoryViewsListQuery(Promise<telegram_api::object_ptr<telegram_api::stories_storyViewsList>> &&promise)
|
||||
: promise_(std::move(promise)) {
|
||||
}
|
||||
|
||||
void send(StoryId story_id, const string &query, bool only_contacts, bool prefer_with_reaction, const string &offset,
|
||||
int32 limit) {
|
||||
void send(DialogId dialog_id, StoryId story_id, const string &query, bool only_contacts, bool prefer_with_reaction,
|
||||
const string &offset, int32 limit) {
|
||||
dialog_id_ = dialog_id;
|
||||
auto input_peer = td_->messages_manager_->get_input_peer(dialog_id_, AccessRights::Write);
|
||||
if (input_peer == nullptr) {
|
||||
return on_error(Status::Error(400, "Can't access the chat"));
|
||||
}
|
||||
|
||||
int32 flags = 0;
|
||||
if (!query.empty()) {
|
||||
flags |= telegram_api::stories_getStoryViewsList::Q_MASK;
|
||||
@ -353,7 +361,7 @@ class GetStoryViewsListQuery final : public Td::ResultHandler {
|
||||
flags |= telegram_api::stories_getStoryViewsList::REACTIONS_FIRST_MASK;
|
||||
}
|
||||
send_query(G()->net_query_creator().create(telegram_api::stories_getStoryViewsList(
|
||||
flags, false /*ignored*/, false /*ignored*/, query, story_id.get(), offset, limit)));
|
||||
flags, false /*ignored*/, false /*ignored*/, std::move(input_peer), query, story_id.get(), offset, limit)));
|
||||
}
|
||||
|
||||
void on_result(BufferSlice packet) final {
|
||||
@ -366,28 +374,29 @@ class GetStoryViewsListQuery final : public Td::ResultHandler {
|
||||
}
|
||||
|
||||
void on_error(Status status) final {
|
||||
td_->messages_manager_->on_get_dialog_error(dialog_id_, status, "GetStoryViewsListQuery");
|
||||
promise_.set_error(std::move(status));
|
||||
}
|
||||
};
|
||||
|
||||
class GetStoriesByIDQuery final : public Td::ResultHandler {
|
||||
Promise<Unit> promise_;
|
||||
UserId user_id_;
|
||||
DialogId dialog_id_;
|
||||
vector<StoryId> story_ids_;
|
||||
|
||||
public:
|
||||
explicit GetStoriesByIDQuery(Promise<Unit> &&promise) : promise_(std::move(promise)) {
|
||||
}
|
||||
|
||||
void send(UserId user_id, vector<StoryId> story_ids) {
|
||||
user_id_ = user_id;
|
||||
void send(DialogId dialog_id, vector<StoryId> story_ids) {
|
||||
dialog_id_ = dialog_id;
|
||||
story_ids_ = std::move(story_ids);
|
||||
auto r_input_user = td_->contacts_manager_->get_input_user(user_id_);
|
||||
if (r_input_user.is_error()) {
|
||||
return on_error(r_input_user.move_as_error());
|
||||
auto input_peer = td_->messages_manager_->get_input_peer(dialog_id_, AccessRights::Read);
|
||||
if (input_peer == nullptr) {
|
||||
return on_error(Status::Error(400, "Can't access the chat"));
|
||||
}
|
||||
send_query(G()->net_query_creator().create(
|
||||
telegram_api::stories_getStoriesByID(r_input_user.move_as_ok(), StoryId::get_input_story_ids(story_ids_))));
|
||||
telegram_api::stories_getStoriesByID(std::move(input_peer), StoryId::get_input_story_ids(story_ids_))));
|
||||
}
|
||||
|
||||
void on_result(BufferSlice packet) final {
|
||||
@ -398,30 +407,33 @@ class GetStoriesByIDQuery final : public Td::ResultHandler {
|
||||
|
||||
auto result = result_ptr.move_as_ok();
|
||||
LOG(DEBUG) << "Receive result for GetStoriesByIDQuery: " << to_string(result);
|
||||
td_->story_manager_->on_get_stories(DialogId(user_id_), std::move(story_ids_), std::move(result));
|
||||
td_->story_manager_->on_get_stories(dialog_id_, std::move(story_ids_), std::move(result));
|
||||
promise_.set_value(Unit());
|
||||
}
|
||||
|
||||
void on_error(Status status) final {
|
||||
td_->messages_manager_->on_get_dialog_error(dialog_id_, status, "GetStoriesByIDQuery");
|
||||
promise_.set_error(std::move(status));
|
||||
}
|
||||
};
|
||||
|
||||
class GetPinnedStoriesQuery final : public Td::ResultHandler {
|
||||
Promise<telegram_api::object_ptr<telegram_api::stories_stories>> promise_;
|
||||
DialogId dialog_id_;
|
||||
|
||||
public:
|
||||
explicit GetPinnedStoriesQuery(Promise<telegram_api::object_ptr<telegram_api::stories_stories>> &&promise)
|
||||
: promise_(std::move(promise)) {
|
||||
}
|
||||
|
||||
void send(UserId user_id, StoryId offset_story_id, int32 limit) {
|
||||
auto r_input_user = td_->contacts_manager_->get_input_user(user_id);
|
||||
if (r_input_user.is_error()) {
|
||||
return on_error(r_input_user.move_as_error());
|
||||
void send(DialogId dialog_id, StoryId offset_story_id, int32 limit) {
|
||||
dialog_id_ = dialog_id;
|
||||
auto input_peer = td_->messages_manager_->get_input_peer(dialog_id_, AccessRights::Read);
|
||||
if (input_peer == nullptr) {
|
||||
return on_error(Status::Error(400, "Can't access the chat"));
|
||||
}
|
||||
send_query(G()->net_query_creator().create(
|
||||
telegram_api::stories_getPinnedStories(r_input_user.move_as_ok(), offset_story_id.get(), limit)));
|
||||
telegram_api::stories_getPinnedStories(std::move(input_peer), offset_story_id.get(), limit)));
|
||||
}
|
||||
|
||||
void on_result(BufferSlice packet) final {
|
||||
@ -436,20 +448,28 @@ class GetPinnedStoriesQuery final : public Td::ResultHandler {
|
||||
}
|
||||
|
||||
void on_error(Status status) final {
|
||||
td_->messages_manager_->on_get_dialog_error(dialog_id_, status, "GetPinnedStoriesQuery");
|
||||
promise_.set_error(std::move(status));
|
||||
}
|
||||
};
|
||||
|
||||
class GetStoriesArchiveQuery final : public Td::ResultHandler {
|
||||
Promise<telegram_api::object_ptr<telegram_api::stories_stories>> promise_;
|
||||
DialogId dialog_id_;
|
||||
|
||||
public:
|
||||
explicit GetStoriesArchiveQuery(Promise<telegram_api::object_ptr<telegram_api::stories_stories>> &&promise)
|
||||
: promise_(std::move(promise)) {
|
||||
}
|
||||
|
||||
void send(StoryId offset_story_id, int32 limit) {
|
||||
send_query(G()->net_query_creator().create(telegram_api::stories_getStoriesArchive(offset_story_id.get(), limit)));
|
||||
void send(DialogId dialog_id, StoryId offset_story_id, int32 limit) {
|
||||
dialog_id_ = dialog_id;
|
||||
auto input_peer = td_->messages_manager_->get_input_peer(dialog_id_, AccessRights::Write);
|
||||
if (input_peer == nullptr) {
|
||||
return on_error(Status::Error(400, "Can't access the chat"));
|
||||
}
|
||||
send_query(G()->net_query_creator().create(
|
||||
telegram_api::stories_getStoriesArchive(std::move(input_peer), offset_story_id.get(), limit)));
|
||||
}
|
||||
|
||||
void on_result(BufferSlice packet) final {
|
||||
@ -464,54 +484,65 @@ class GetStoriesArchiveQuery final : public Td::ResultHandler {
|
||||
}
|
||||
|
||||
void on_error(Status status) final {
|
||||
td_->messages_manager_->on_get_dialog_error(dialog_id_, status, "GetStoriesArchiveQuery");
|
||||
promise_.set_error(std::move(status));
|
||||
}
|
||||
};
|
||||
|
||||
class GetUserStoriesQuery final : public Td::ResultHandler {
|
||||
Promise<telegram_api::object_ptr<telegram_api::stories_userStories>> promise_;
|
||||
class GetPeerStoriesQuery final : public Td::ResultHandler {
|
||||
Promise<telegram_api::object_ptr<telegram_api::stories_peerStories>> promise_;
|
||||
DialogId dialog_id_;
|
||||
|
||||
public:
|
||||
explicit GetUserStoriesQuery(Promise<telegram_api::object_ptr<telegram_api::stories_userStories>> &&promise)
|
||||
explicit GetPeerStoriesQuery(Promise<telegram_api::object_ptr<telegram_api::stories_peerStories>> &&promise)
|
||||
: promise_(std::move(promise)) {
|
||||
}
|
||||
|
||||
void send(UserId user_id) {
|
||||
auto r_input_user = td_->contacts_manager_->get_input_user(user_id);
|
||||
if (r_input_user.is_error()) {
|
||||
return on_error(r_input_user.move_as_error());
|
||||
void send(DialogId dialog_id) {
|
||||
dialog_id_ = dialog_id;
|
||||
auto input_peer = td_->messages_manager_->get_input_peer(dialog_id_, AccessRights::Read);
|
||||
if (input_peer == nullptr) {
|
||||
return on_error(Status::Error(400, "Can't access the chat"));
|
||||
}
|
||||
send_query(G()->net_query_creator().create(telegram_api::stories_getUserStories(r_input_user.move_as_ok()),
|
||||
{{DialogId(user_id)}}));
|
||||
send_query(
|
||||
G()->net_query_creator().create(telegram_api::stories_getPeerStories(std::move(input_peer)), {{dialog_id}}));
|
||||
}
|
||||
|
||||
void on_result(BufferSlice packet) final {
|
||||
auto result_ptr = fetch_result<telegram_api::stories_getUserStories>(packet);
|
||||
auto result_ptr = fetch_result<telegram_api::stories_getPeerStories>(packet);
|
||||
if (result_ptr.is_error()) {
|
||||
return on_error(result_ptr.move_as_error());
|
||||
}
|
||||
|
||||
auto result = result_ptr.move_as_ok();
|
||||
LOG(DEBUG) << "Receive result for GetUserStoriesQuery: " << to_string(result);
|
||||
LOG(DEBUG) << "Receive result for GetPeerStoriesQuery: " << to_string(result);
|
||||
promise_.set_value(std::move(result));
|
||||
}
|
||||
|
||||
void on_error(Status status) final {
|
||||
td_->messages_manager_->on_get_dialog_error(dialog_id_, status, "GetPeerStoriesQuery");
|
||||
promise_.set_error(std::move(status));
|
||||
}
|
||||
};
|
||||
|
||||
class EditStoryPrivacyQuery final : public Td::ResultHandler {
|
||||
Promise<Unit> promise_;
|
||||
DialogId dialog_id_;
|
||||
|
||||
public:
|
||||
explicit EditStoryPrivacyQuery(Promise<Unit> &&promise) : promise_(std::move(promise)) {
|
||||
}
|
||||
|
||||
void send(DialogId dialog_id, StoryId story_id, UserPrivacySettingRules &&privacy_rules) {
|
||||
dialog_id_ = dialog_id;
|
||||
auto input_peer = td_->messages_manager_->get_input_peer(dialog_id_, AccessRights::Write);
|
||||
if (input_peer == nullptr) {
|
||||
return on_error(Status::Error(400, "Can't access the chat"));
|
||||
}
|
||||
|
||||
int32 flags = telegram_api::stories_editStory::PRIVACY_RULES_MASK;
|
||||
send_query(G()->net_query_creator().create(
|
||||
telegram_api::stories_editStory(flags, story_id.get(), nullptr,
|
||||
telegram_api::stories_editStory(flags, std::move(input_peer), story_id.get(), nullptr,
|
||||
vector<telegram_api::object_ptr<telegram_api::MediaArea>>(), string(),
|
||||
vector<telegram_api::object_ptr<telegram_api::MessageEntity>>(),
|
||||
privacy_rules.get_input_privacy_rules(td_)),
|
||||
@ -533,19 +564,27 @@ class EditStoryPrivacyQuery final : public Td::ResultHandler {
|
||||
if (!td_->auth_manager_->is_bot() && status.message() == "STORY_NOT_MODIFIED") {
|
||||
return promise_.set_value(Unit());
|
||||
}
|
||||
td_->messages_manager_->on_get_dialog_error(dialog_id_, status, "EditStoryPrivacyQuery");
|
||||
promise_.set_error(std::move(status));
|
||||
}
|
||||
};
|
||||
|
||||
class ToggleStoryPinnedQuery final : public Td::ResultHandler {
|
||||
Promise<Unit> promise_;
|
||||
DialogId dialog_id_;
|
||||
|
||||
public:
|
||||
explicit ToggleStoryPinnedQuery(Promise<Unit> &&promise) : promise_(std::move(promise)) {
|
||||
}
|
||||
|
||||
void send(DialogId dialog_id, StoryId story_id, bool is_pinned) {
|
||||
send_query(G()->net_query_creator().create(telegram_api::stories_togglePinned({story_id.get()}, is_pinned),
|
||||
dialog_id_ = dialog_id;
|
||||
auto input_peer = td_->messages_manager_->get_input_peer(dialog_id_, AccessRights::Write);
|
||||
if (input_peer == nullptr) {
|
||||
return on_error(Status::Error(400, "Can't access the chat"));
|
||||
}
|
||||
send_query(G()->net_query_creator().create(
|
||||
telegram_api::stories_togglePinned(std::move(input_peer), {story_id.get()}, is_pinned),
|
||||
{{StoryFullId{dialog_id, story_id}}}));
|
||||
}
|
||||
|
||||
@ -561,20 +600,27 @@ class ToggleStoryPinnedQuery final : public Td::ResultHandler {
|
||||
}
|
||||
|
||||
void on_error(Status status) final {
|
||||
td_->messages_manager_->on_get_dialog_error(dialog_id_, status, "ToggleStoryPinnedQuery");
|
||||
promise_.set_error(std::move(status));
|
||||
}
|
||||
};
|
||||
|
||||
class DeleteStoriesQuery final : public Td::ResultHandler {
|
||||
Promise<Unit> promise_;
|
||||
DialogId dialog_id_;
|
||||
|
||||
public:
|
||||
explicit DeleteStoriesQuery(Promise<Unit> &&promise) : promise_(std::move(promise)) {
|
||||
}
|
||||
|
||||
void send(const vector<StoryId> &story_ids) {
|
||||
send_query(
|
||||
G()->net_query_creator().create(telegram_api::stories_deleteStories(StoryId::get_input_story_ids(story_ids))));
|
||||
void send(DialogId dialog_id, const vector<StoryId> &story_ids) {
|
||||
dialog_id_ = dialog_id;
|
||||
auto input_peer = td_->messages_manager_->get_input_peer(dialog_id_, AccessRights::Write);
|
||||
if (input_peer == nullptr) {
|
||||
return on_error(Status::Error(400, "Can't access the chat"));
|
||||
}
|
||||
send_query(G()->net_query_creator().create(
|
||||
telegram_api::stories_deleteStories(std::move(input_peer), StoryId::get_input_story_ids(story_ids))));
|
||||
}
|
||||
|
||||
void on_result(BufferSlice packet) final {
|
||||
@ -589,18 +635,25 @@ class DeleteStoriesQuery final : public Td::ResultHandler {
|
||||
}
|
||||
|
||||
void on_error(Status status) final {
|
||||
td_->messages_manager_->on_get_dialog_error(dialog_id_, status, "DeleteStoriesQuery");
|
||||
promise_.set_error(std::move(status));
|
||||
}
|
||||
};
|
||||
|
||||
class GetStoriesViewsQuery final : public Td::ResultHandler {
|
||||
vector<StoryId> story_ids_;
|
||||
DialogId dialog_id_;
|
||||
|
||||
public:
|
||||
void send(vector<StoryId> story_ids) {
|
||||
void send(DialogId dialog_id, vector<StoryId> story_ids) {
|
||||
dialog_id_ = dialog_id;
|
||||
story_ids_ = std::move(story_ids);
|
||||
auto input_peer = td_->messages_manager_->get_input_peer(dialog_id_, AccessRights::Read);
|
||||
if (input_peer == nullptr) {
|
||||
return on_error(Status::Error(400, "Can't access the chat"));
|
||||
}
|
||||
send_query(G()->net_query_creator().create(
|
||||
telegram_api::stories_getStoriesViews(StoryId::get_input_story_ids(story_ids_))));
|
||||
telegram_api::stories_getStoriesViews(std::move(input_peer), StoryId::get_input_story_ids(story_ids_))));
|
||||
}
|
||||
|
||||
void on_result(BufferSlice packet) final {
|
||||
@ -616,6 +669,7 @@ class GetStoriesViewsQuery final : public Td::ResultHandler {
|
||||
|
||||
void on_error(Status status) final {
|
||||
LOG(INFO) << "Receive error for GetStoriesViewsQuery for " << story_ids_ << ": " << status;
|
||||
td_->messages_manager_->on_get_dialog_error(dialog_id_, status, "GetStoriesViewsQuery");
|
||||
}
|
||||
};
|
||||
|
||||
@ -629,15 +683,13 @@ class ReportStoryQuery final : public Td::ResultHandler {
|
||||
|
||||
void send(StoryFullId story_full_id, ReportReason &&report_reason) {
|
||||
dialog_id_ = story_full_id.get_dialog_id();
|
||||
CHECK(dialog_id_.get_type() == DialogType::User);
|
||||
|
||||
auto r_input_user = td_->contacts_manager_->get_input_user(dialog_id_.get_user_id());
|
||||
if (r_input_user.is_error()) {
|
||||
return on_error(r_input_user.move_as_error());
|
||||
auto input_peer = td_->messages_manager_->get_input_peer(dialog_id_, AccessRights::Read);
|
||||
if (input_peer == nullptr) {
|
||||
return on_error(Status::Error(400, "Can't access the chat"));
|
||||
}
|
||||
|
||||
send_query(G()->net_query_creator().create(
|
||||
telegram_api::stories_report(r_input_user.move_as_ok(), {story_full_id.get_story_id().get()},
|
||||
telegram_api::stories_report(std::move(input_peer), {story_full_id.get_story_id().get()},
|
||||
report_reason.get_input_report_reason(), report_reason.get_message())));
|
||||
}
|
||||
|
||||
@ -689,14 +741,20 @@ class ActivateStealthModeQuery final : public Td::ResultHandler {
|
||||
|
||||
class CanSendStoryQuery final : public Td::ResultHandler {
|
||||
Promise<td_api::object_ptr<td_api::CanSendStoryResult>> promise_;
|
||||
DialogId dialog_id_;
|
||||
|
||||
public:
|
||||
explicit CanSendStoryQuery(Promise<td_api::object_ptr<td_api::CanSendStoryResult>> &&promise)
|
||||
: promise_(std::move(promise)) {
|
||||
}
|
||||
|
||||
void send() {
|
||||
send_query(G()->net_query_creator().create(telegram_api::stories_canSendStory()));
|
||||
void send(DialogId dialog_id) {
|
||||
dialog_id_ = dialog_id;
|
||||
auto input_peer = td_->messages_manager_->get_input_peer(dialog_id_, AccessRights::Write);
|
||||
if (input_peer == nullptr) {
|
||||
return on_error(Status::Error(400, "Can't access the chat"));
|
||||
}
|
||||
send_query(G()->net_query_creator().create(telegram_api::stories_canSendStory(std::move(input_peer))));
|
||||
}
|
||||
|
||||
void on_result(BufferSlice packet) final {
|
||||
@ -713,11 +771,13 @@ class CanSendStoryQuery final : public Td::ResultHandler {
|
||||
if (result != nullptr) {
|
||||
return promise_.set_value(std::move(result));
|
||||
}
|
||||
return promise_.set_error(std::move(status));
|
||||
td_->messages_manager_->on_get_dialog_error(dialog_id_, status, "CanSendStoryQuery");
|
||||
promise_.set_error(std::move(status));
|
||||
}
|
||||
};
|
||||
|
||||
class StoryManager::SendStoryQuery final : public Td::ResultHandler {
|
||||
DialogId dialog_id_;
|
||||
FileId file_id_;
|
||||
unique_ptr<PendingStory> pending_story_;
|
||||
|
||||
@ -727,6 +787,7 @@ class StoryManager::SendStoryQuery final : public Td::ResultHandler {
|
||||
file_id_ = file_id;
|
||||
pending_story_ = std::move(pending_story);
|
||||
CHECK(pending_story_ != nullptr);
|
||||
dialog_id_ = pending_story_->dialog_id_;
|
||||
|
||||
const auto *story = pending_story_->story_.get();
|
||||
const StoryContent *content = story->content_.get();
|
||||
@ -734,6 +795,11 @@ class StoryManager::SendStoryQuery final : public Td::ResultHandler {
|
||||
auto input_media = get_story_content_input_media(td_, content, std::move(input_file));
|
||||
CHECK(input_media != nullptr);
|
||||
|
||||
auto input_peer = td_->messages_manager_->get_input_peer(dialog_id_, AccessRights::Write);
|
||||
if (input_peer == nullptr) {
|
||||
return on_error(Status::Error(400, "Can't access the chat"));
|
||||
}
|
||||
|
||||
const FormattedText &caption = story->caption_;
|
||||
auto entities = get_input_message_entities(td_->contacts_manager_.get(), &caption, "SendStoryQuery");
|
||||
if (!td_->option_manager_->get_option_boolean("can_use_text_entities_in_story_caption")) {
|
||||
@ -766,9 +832,10 @@ class StoryManager::SendStoryQuery final : public Td::ResultHandler {
|
||||
}
|
||||
|
||||
send_query(G()->net_query_creator().create(
|
||||
telegram_api::stories_sendStory(flags, false /*ignored*/, false /*ignored*/, std::move(input_media),
|
||||
std::move(media_areas), caption.text, std::move(entities),
|
||||
std::move(privacy_rules), pending_story_->random_id_, period),
|
||||
telegram_api::stories_sendStory(flags, false /*ignored*/, false /*ignored*/, std::move(input_peer),
|
||||
std::move(input_media), std::move(media_areas), caption.text,
|
||||
std::move(entities), std::move(privacy_rules), pending_story_->random_id_,
|
||||
period),
|
||||
{{pending_story_->dialog_id_}}));
|
||||
}
|
||||
|
||||
@ -799,13 +866,15 @@ class StoryManager::SendStoryQuery final : public Td::ResultHandler {
|
||||
if (!bad_parts.empty()) {
|
||||
td_->story_manager_->on_send_story_file_parts_missing(std::move(pending_story_), std::move(bad_parts));
|
||||
return;
|
||||
} else {
|
||||
td_->story_manager_->delete_pending_story(file_id_, std::move(pending_story_), std::move(status));
|
||||
}
|
||||
|
||||
td_->messages_manager_->on_get_dialog_error(dialog_id_, status, "SendStoryQuery");
|
||||
td_->story_manager_->delete_pending_story(file_id_, std::move(pending_story_), std::move(status));
|
||||
}
|
||||
};
|
||||
|
||||
class StoryManager::EditStoryQuery final : public Td::ResultHandler {
|
||||
DialogId dialog_id_;
|
||||
FileId file_id_;
|
||||
unique_ptr<PendingStory> pending_story_;
|
||||
|
||||
@ -815,6 +884,12 @@ class StoryManager::EditStoryQuery final : public Td::ResultHandler {
|
||||
file_id_ = file_id;
|
||||
pending_story_ = std::move(pending_story);
|
||||
CHECK(pending_story_ != nullptr);
|
||||
dialog_id_ = pending_story_->dialog_id_;
|
||||
|
||||
auto input_peer = td_->messages_manager_->get_input_peer(dialog_id_, AccessRights::Write);
|
||||
if (input_peer == nullptr) {
|
||||
return on_error(Status::Error(400, "Can't access the chat"));
|
||||
}
|
||||
|
||||
int32 flags = 0;
|
||||
|
||||
@ -849,9 +924,9 @@ class StoryManager::EditStoryQuery final : public Td::ResultHandler {
|
||||
}
|
||||
|
||||
send_query(G()->net_query_creator().create(
|
||||
telegram_api::stories_editStory(flags, pending_story_->story_id_.get(), std::move(input_media),
|
||||
std::move(media_areas), edited_story->caption_.text, std::move(entities),
|
||||
Auto()),
|
||||
telegram_api::stories_editStory(flags, std::move(input_peer), pending_story_->story_id_.get(),
|
||||
std::move(input_media), std::move(media_areas), edited_story->caption_.text,
|
||||
std::move(entities), Auto()),
|
||||
{{StoryFullId{pending_story_->dialog_id_, pending_story_->story_id_}}}));
|
||||
}
|
||||
|
||||
@ -887,6 +962,8 @@ class StoryManager::EditStoryQuery final : public Td::ResultHandler {
|
||||
td_->story_manager_->on_send_story_file_parts_missing(std::move(pending_story_), std::move(bad_parts));
|
||||
return;
|
||||
}
|
||||
|
||||
td_->messages_manager_->on_get_dialog_error(dialog_id_, status, "EditStoryQuery");
|
||||
td_->story_manager_->delete_pending_story(file_id_, std::move(pending_story_), std::move(status));
|
||||
}
|
||||
};
|
||||
@ -1729,6 +1806,7 @@ void StoryManager::on_load_active_stories_from_server(
|
||||
case telegram_api::stories_allStories::ID: {
|
||||
auto stories = telegram_api::move_object_as<telegram_api::stories_allStories>(all_stories);
|
||||
td_->contacts_manager_->on_get_users(std::move(stories->users_), "on_load_active_stories_from_server");
|
||||
td_->contacts_manager_->on_get_chats(std::move(stories->chats_), "on_load_active_stories_from_server");
|
||||
if (stories->state_.empty()) {
|
||||
LOG(ERROR) << "Receive empty state in " << to_string(stories);
|
||||
} else {
|
||||
@ -1736,7 +1814,7 @@ void StoryManager::on_load_active_stories_from_server(
|
||||
}
|
||||
story_list.server_total_count_ = max(stories->count_, 0);
|
||||
story_list.is_reloaded_server_total_count_ = true;
|
||||
if (!stories->has_more_ || stories->user_stories_.empty()) {
|
||||
if (!stories->has_more_ || stories->peer_stories_.empty()) {
|
||||
story_list.server_has_more_ = false;
|
||||
}
|
||||
|
||||
@ -1751,15 +1829,15 @@ void StoryManager::on_load_active_stories_from_server(
|
||||
}));
|
||||
auto lock = mpas.get_promise();
|
||||
|
||||
if (stories->user_stories_.empty() && stories->has_more_) {
|
||||
if (stories->peer_stories_.empty() && stories->has_more_) {
|
||||
LOG(ERROR) << "Receive no stories, but expected more";
|
||||
stories->has_more_ = false;
|
||||
}
|
||||
|
||||
auto max_story_date = MIN_DIALOG_DATE;
|
||||
vector<DialogId> owner_dialog_ids;
|
||||
for (auto &user_stories : stories->user_stories_) {
|
||||
auto owner_dialog_id = on_get_user_stories(DialogId(), std::move(user_stories), mpas.get_promise());
|
||||
for (auto &peer_stories : stories->peer_stories_) {
|
||||
auto owner_dialog_id = on_get_dialog_stories(DialogId(), std::move(peer_stories), mpas.get_promise());
|
||||
auto active_stories = get_active_stories(owner_dialog_id);
|
||||
if (active_stories == nullptr) {
|
||||
LOG(ERROR) << "Receive invalid stories";
|
||||
@ -1883,7 +1961,7 @@ void StoryManager::update_story_list_sent_total_count(StoryListId story_list_id,
|
||||
}
|
||||
|
||||
void StoryManager::reload_all_read_stories() {
|
||||
td_->create_handler<GetAllReadUserStoriesQuery>()->send();
|
||||
td_->create_handler<GetAllReadPeerStoriesQuery>()->send();
|
||||
}
|
||||
|
||||
void StoryManager::try_synchronize_archive_all_stories() {
|
||||
@ -1932,9 +2010,6 @@ void StoryManager::toggle_dialog_stories_hidden(DialogId dialog_id, StoryListId
|
||||
if (!td_->messages_manager_->have_input_peer(dialog_id, AccessRights::Read)) {
|
||||
return promise.set_error(Status::Error(400, "Can't access the story sender"));
|
||||
}
|
||||
if (dialog_id.get_type() != DialogType::User) {
|
||||
return promise.set_error(Status::Error(400, "Can't archive sender stories"));
|
||||
}
|
||||
if (story_list_id == get_dialog_story_list_id(dialog_id)) {
|
||||
return promise.set_value(Unit());
|
||||
}
|
||||
@ -1943,7 +2018,7 @@ void StoryManager::toggle_dialog_stories_hidden(DialogId dialog_id, StoryListId
|
||||
}
|
||||
|
||||
td_->create_handler<ToggleStoriesHiddenQuery>(std::move(promise))
|
||||
->send(dialog_id.get_user_id(), story_list_id == StoryListId::archive());
|
||||
->send(dialog_id, story_list_id == StoryListId::archive());
|
||||
}
|
||||
|
||||
void StoryManager::get_dialog_pinned_stories(DialogId owner_dialog_id, StoryId from_story_id, int32 limit,
|
||||
@ -1958,9 +2033,6 @@ void StoryManager::get_dialog_pinned_stories(DialogId owner_dialog_id, StoryId f
|
||||
if (!td_->messages_manager_->have_input_peer(owner_dialog_id, AccessRights::Read)) {
|
||||
return promise.set_error(Status::Error(400, "Can't access the story sender"));
|
||||
}
|
||||
if (owner_dialog_id.get_type() != DialogType::User) {
|
||||
return promise.set_value(td_api::make_object<td_api::stories>());
|
||||
}
|
||||
|
||||
if (from_story_id != StoryId() && !from_story_id.is_server()) {
|
||||
return promise.set_error(Status::Error(400, "Invalid value of parameter from_story_id specified"));
|
||||
@ -1975,8 +2047,7 @@ void StoryManager::get_dialog_pinned_stories(DialogId owner_dialog_id, StoryId f
|
||||
send_closure(actor_id, &StoryManager::on_get_dialog_pinned_stories, owner_dialog_id, result.move_as_ok(),
|
||||
std::move(promise));
|
||||
});
|
||||
td_->create_handler<GetPinnedStoriesQuery>(std::move(query_promise))
|
||||
->send(owner_dialog_id.get_user_id(), from_story_id, limit);
|
||||
td_->create_handler<GetPinnedStoriesQuery>(std::move(query_promise))->send(owner_dialog_id, from_story_id, limit);
|
||||
}
|
||||
|
||||
void StoryManager::on_get_dialog_pinned_stories(DialogId owner_dialog_id,
|
||||
@ -2000,24 +2071,26 @@ void StoryManager::get_story_archive(StoryId from_story_id, int32 limit,
|
||||
return promise.set_error(Status::Error(400, "Invalid value of parameter from_story_id specified"));
|
||||
}
|
||||
|
||||
DialogId owner_dialog_id(td_->contacts_manager_->get_my_id());
|
||||
auto query_promise =
|
||||
PromiseCreator::lambda([actor_id = actor_id(this), promise = std::move(promise)](
|
||||
PromiseCreator::lambda([actor_id = actor_id(this), owner_dialog_id, promise = std::move(promise)](
|
||||
Result<telegram_api::object_ptr<telegram_api::stories_stories>> &&result) mutable {
|
||||
if (result.is_error()) {
|
||||
return promise.set_error(result.move_as_error());
|
||||
}
|
||||
send_closure(actor_id, &StoryManager::on_get_story_archive, result.move_as_ok(), std::move(promise));
|
||||
send_closure(actor_id, &StoryManager::on_get_story_archive, owner_dialog_id, result.move_as_ok(),
|
||||
std::move(promise));
|
||||
});
|
||||
td_->create_handler<GetStoriesArchiveQuery>(std::move(query_promise))->send(from_story_id, limit);
|
||||
td_->create_handler<GetStoriesArchiveQuery>(std::move(query_promise))->send(owner_dialog_id, from_story_id, limit);
|
||||
}
|
||||
|
||||
void StoryManager::on_get_story_archive(telegram_api::object_ptr<telegram_api::stories_stories> &&stories,
|
||||
void StoryManager::on_get_story_archive(DialogId owner_dialog_id,
|
||||
telegram_api::object_ptr<telegram_api::stories_stories> &&stories,
|
||||
Promise<td_api::object_ptr<td_api::stories>> &&promise) {
|
||||
TRY_STATUS_PROMISE(promise, G()->close_status());
|
||||
DialogId dialog_id(td_->contacts_manager_->get_my_id());
|
||||
auto result = on_get_stories(dialog_id, {}, std::move(stories));
|
||||
promise.set_value(get_stories_object(result.first, transform(result.second, [dialog_id](StoryId story_id) {
|
||||
return StoryFullId(dialog_id, story_id);
|
||||
auto result = on_get_stories(owner_dialog_id, {}, std::move(stories));
|
||||
promise.set_value(get_stories_object(result.first, transform(result.second, [owner_dialog_id](StoryId story_id) {
|
||||
return StoryFullId(owner_dialog_id, story_id);
|
||||
})));
|
||||
}
|
||||
|
||||
@ -2030,12 +2103,6 @@ void StoryManager::get_dialog_expiring_stories(DialogId owner_dialog_id,
|
||||
if (!td_->messages_manager_->have_input_peer(owner_dialog_id, AccessRights::Read)) {
|
||||
return promise.set_error(Status::Error(400, "Can't access the story sender"));
|
||||
}
|
||||
if (owner_dialog_id.get_type() != DialogType::User) {
|
||||
if (updated_active_stories_.insert(owner_dialog_id)) {
|
||||
send_update_chat_active_stories(owner_dialog_id, nullptr, "get_dialog_expiring_stories 1");
|
||||
}
|
||||
return promise.set_value(get_chat_active_stories_object(owner_dialog_id, nullptr));
|
||||
}
|
||||
|
||||
LOG(INFO) << "Get active stories in " << owner_dialog_id;
|
||||
auto active_stories = get_active_stories_force(owner_dialog_id, "get_dialog_expiring_stories");
|
||||
@ -2052,14 +2119,14 @@ void StoryManager::get_dialog_expiring_stories(DialogId owner_dialog_id,
|
||||
|
||||
auto query_promise =
|
||||
PromiseCreator::lambda([actor_id = actor_id(this), owner_dialog_id, promise = std::move(promise)](
|
||||
Result<telegram_api::object_ptr<telegram_api::stories_userStories>> &&result) mutable {
|
||||
Result<telegram_api::object_ptr<telegram_api::stories_peerStories>> &&result) mutable {
|
||||
if (result.is_error()) {
|
||||
return promise.set_error(result.move_as_error());
|
||||
}
|
||||
send_closure(actor_id, &StoryManager::on_get_dialog_expiring_stories, owner_dialog_id, result.move_as_ok(),
|
||||
std::move(promise));
|
||||
});
|
||||
td_->create_handler<GetUserStoriesQuery>(std::move(query_promise))->send(owner_dialog_id.get_user_id());
|
||||
td_->create_handler<GetPeerStoriesQuery>(std::move(query_promise))->send(owner_dialog_id);
|
||||
}
|
||||
|
||||
void StoryManager::reload_dialog_expiring_stories(DialogId dialog_id) {
|
||||
@ -2131,11 +2198,12 @@ void StoryManager::on_load_dialog_expiring_stories(DialogId owner_dialog_id) {
|
||||
}
|
||||
|
||||
void StoryManager::on_get_dialog_expiring_stories(DialogId owner_dialog_id,
|
||||
telegram_api::object_ptr<telegram_api::stories_userStories> &&stories,
|
||||
telegram_api::object_ptr<telegram_api::stories_peerStories> &&stories,
|
||||
Promise<td_api::object_ptr<td_api::chatActiveStories>> &&promise) {
|
||||
TRY_STATUS_PROMISE(promise, G()->close_status());
|
||||
td_->contacts_manager_->on_get_users(std::move(stories->users_), "on_get_dialog_expiring_stories");
|
||||
owner_dialog_id = on_get_user_stories(owner_dialog_id, std::move(stories->stories_), Promise<Unit>());
|
||||
td_->contacts_manager_->on_get_chats(std::move(stories->chats_), "on_get_dialog_expiring_stories");
|
||||
owner_dialog_id = on_get_dialog_stories(owner_dialog_id, std::move(stories->stories_), Promise<Unit>());
|
||||
if (promise) {
|
||||
auto active_stories = get_active_stories(owner_dialog_id);
|
||||
if (updated_active_stories_.insert(owner_dialog_id)) {
|
||||
@ -2170,7 +2238,7 @@ void StoryManager::open_story(DialogId owner_dialog_id, StoryId story_id, Promis
|
||||
}
|
||||
auto &open_count = opened_owned_stories_[story_full_id];
|
||||
if (++open_count == 1) {
|
||||
td_->create_handler<GetStoriesViewsQuery>()->send({story_id});
|
||||
td_->create_handler<GetStoriesViewsQuery>()->send(owner_dialog_id, {story_id});
|
||||
}
|
||||
}
|
||||
|
||||
@ -2274,7 +2342,7 @@ void StoryManager::on_story_replied(StoryFullId story_full_id, UserId replier_us
|
||||
|
||||
if (story->content_ != nullptr && G()->unix_time() < get_story_viewers_expire_date(story) &&
|
||||
story->interaction_info_.definitely_has_no_user(replier_user_id)) {
|
||||
td_->create_handler<GetStoriesViewsQuery>()->send({story_full_id.get_story_id()});
|
||||
td_->create_handler<GetStoriesViewsQuery>()->send(story_full_id.get_dialog_id(), {story_full_id.get_story_id()});
|
||||
}
|
||||
}
|
||||
|
||||
@ -2380,8 +2448,7 @@ void StoryManager::update_interaction_info() {
|
||||
}
|
||||
}
|
||||
for (auto &story_ids : split_story_ids) {
|
||||
CHECK(story_ids.first == DialogId(td_->contacts_manager_->get_my_id()));
|
||||
td_->create_handler<GetStoriesViewsQuery>()->send(std::move(story_ids.second));
|
||||
td_->create_handler<GetStoriesViewsQuery>()->send(story_ids.first, std::move(story_ids.second));
|
||||
}
|
||||
}
|
||||
|
||||
@ -2494,7 +2561,7 @@ void StoryManager::get_story_viewers(StoryId story_id, const string &query, bool
|
||||
});
|
||||
|
||||
td_->create_handler<GetStoryViewsListQuery>(std::move(query_promise))
|
||||
->send(story_full_id.get_story_id(), query, only_contacts, prefer_with_reaction, offset, limit);
|
||||
->send(owner_dialog_id, story_id, query, only_contacts, prefer_with_reaction, offset, limit);
|
||||
}
|
||||
|
||||
void StoryManager::on_get_story_viewers(
|
||||
@ -3215,6 +3282,7 @@ std::pair<int32, vector<StoryId>> StoryManager::on_get_stories(
|
||||
DialogId owner_dialog_id, vector<StoryId> &&expected_story_ids,
|
||||
telegram_api::object_ptr<telegram_api::stories_stories> &&stories) {
|
||||
td_->contacts_manager_->on_get_users(std::move(stories->users_), "on_get_stories");
|
||||
td_->contacts_manager_->on_get_chats(std::move(stories->chats_), "on_get_stories");
|
||||
|
||||
vector<StoryId> story_ids;
|
||||
for (auto &story : stories->stories_) {
|
||||
@ -3260,23 +3328,23 @@ std::pair<int32, vector<StoryId>> StoryManager::on_get_stories(
|
||||
return {total_count, std::move(story_ids)};
|
||||
}
|
||||
|
||||
DialogId StoryManager::on_get_user_stories(DialogId owner_dialog_id,
|
||||
telegram_api::object_ptr<telegram_api::userStories> &&user_stories,
|
||||
DialogId StoryManager::on_get_dialog_stories(DialogId owner_dialog_id,
|
||||
telegram_api::object_ptr<telegram_api::peerStories> &&peer_stories,
|
||||
Promise<Unit> &&promise) {
|
||||
if (user_stories == nullptr) {
|
||||
if (peer_stories == nullptr) {
|
||||
if (owner_dialog_id.is_valid()) {
|
||||
LOG(INFO) << "Receive no stories in " << owner_dialog_id;
|
||||
on_update_active_stories(owner_dialog_id, StoryId(), {}, std::move(promise), "on_get_user_stories");
|
||||
on_update_active_stories(owner_dialog_id, StoryId(), {}, std::move(promise), "on_get_dialog_stories");
|
||||
} else {
|
||||
promise.set_value(Unit());
|
||||
}
|
||||
return owner_dialog_id;
|
||||
}
|
||||
|
||||
DialogId story_dialog_id(UserId(user_stories->user_id_));
|
||||
DialogId story_dialog_id(peer_stories->peer_);
|
||||
if (owner_dialog_id.is_valid() && owner_dialog_id != story_dialog_id) {
|
||||
LOG(ERROR) << "Receive stories from " << story_dialog_id << " instead of " << owner_dialog_id;
|
||||
on_update_active_stories(owner_dialog_id, StoryId(), {}, std::move(promise), "on_get_user_stories 2");
|
||||
on_update_active_stories(owner_dialog_id, StoryId(), {}, std::move(promise), "on_get_dialog_stories 2");
|
||||
return owner_dialog_id;
|
||||
}
|
||||
if (!story_dialog_id.is_valid()) {
|
||||
@ -3286,14 +3354,14 @@ DialogId StoryManager::on_get_user_stories(DialogId owner_dialog_id,
|
||||
}
|
||||
owner_dialog_id = story_dialog_id;
|
||||
|
||||
StoryId max_read_story_id(user_stories->max_read_id_);
|
||||
StoryId max_read_story_id(peer_stories->max_read_id_);
|
||||
if (!max_read_story_id.is_server() && max_read_story_id != StoryId()) {
|
||||
LOG(ERROR) << "Receive max read " << max_read_story_id;
|
||||
max_read_story_id = StoryId();
|
||||
}
|
||||
|
||||
vector<StoryId> story_ids;
|
||||
for (auto &story : user_stories->stories_) {
|
||||
for (auto &story : peer_stories->stories_) {
|
||||
switch (story->get_id()) {
|
||||
case telegram_api::storyItemDeleted::ID:
|
||||
on_get_deleted_story(owner_dialog_id, telegram_api::move_object_as<telegram_api::storyItemDeleted>(story));
|
||||
@ -3312,7 +3380,7 @@ DialogId StoryManager::on_get_user_stories(DialogId owner_dialog_id,
|
||||
}
|
||||
|
||||
on_update_active_stories(story_dialog_id, max_read_story_id, std::move(story_ids), std::move(promise),
|
||||
"on_get_user_stories 3");
|
||||
"on_get_dialog_stories 3");
|
||||
return story_dialog_id;
|
||||
}
|
||||
|
||||
@ -3867,9 +3935,6 @@ void StoryManager::reload_story(StoryFullId story_full_id, Promise<Unit> &&promi
|
||||
|
||||
LOG(INFO) << "Reload " << story_full_id << " from " << source;
|
||||
auto dialog_id = story_full_id.get_dialog_id();
|
||||
if (dialog_id.get_type() != DialogType::User) {
|
||||
return promise.set_error(Status::Error(400, "Unsupported story owner"));
|
||||
}
|
||||
auto story_id = story_full_id.get_story_id();
|
||||
if (!story_id.is_server()) {
|
||||
return promise.set_error(Status::Error(400, "Invalid story identifier"));
|
||||
@ -3888,7 +3953,7 @@ void StoryManager::reload_story(StoryFullId story_full_id, Promise<Unit> &&promi
|
||||
PromiseCreator::lambda([actor_id = actor_id(this), story_full_id](Result<Unit> &&result) mutable {
|
||||
send_closure(actor_id, &StoryManager::on_reload_story, story_full_id, std::move(result));
|
||||
});
|
||||
td_->create_handler<GetStoriesByIDQuery>(std::move(query_promise))->send(dialog_id.get_user_id(), {story_id});
|
||||
td_->create_handler<GetStoriesByIDQuery>(std::move(query_promise))->send(dialog_id, {story_id});
|
||||
}
|
||||
|
||||
void StoryManager::on_reload_story(StoryFullId story_full_id, Result<Unit> &&result) {
|
||||
@ -3928,7 +3993,7 @@ void StoryManager::get_story(DialogId owner_dialog_id, StoryId story_id, bool on
|
||||
}
|
||||
return promise.set_value(get_story_object(story_full_id, story));
|
||||
}
|
||||
if (only_local || owner_dialog_id.get_type() != DialogType::User || !story_id.is_server()) {
|
||||
if (only_local || !story_id.is_server()) {
|
||||
return promise.set_value(nullptr);
|
||||
}
|
||||
|
||||
@ -3963,7 +4028,8 @@ Result<StoryId> StoryManager::get_next_yet_unsent_story_id(DialogId dialog_id) {
|
||||
}
|
||||
|
||||
void StoryManager::can_send_story(Promise<td_api::object_ptr<td_api::CanSendStoryResult>> &&promise) {
|
||||
td_->create_handler<CanSendStoryQuery>(std::move(promise))->send();
|
||||
DialogId dialog_id(td_->contacts_manager_->get_my_id());
|
||||
td_->create_handler<CanSendStoryQuery>(std::move(promise))->send(dialog_id);
|
||||
}
|
||||
|
||||
void StoryManager::send_story(td_api::object_ptr<td_api::InputStoryContent> &&input_story_content,
|
||||
@ -4614,19 +4680,19 @@ void StoryManager::delete_story_on_server(StoryFullId story_full_id, uint64 log_
|
||||
|
||||
deleted_story_full_ids_.insert(story_full_id);
|
||||
|
||||
td_->create_handler<DeleteStoriesQuery>(std::move(promise))->send({story_full_id.get_story_id()});
|
||||
td_->create_handler<DeleteStoriesQuery>(std::move(promise))
|
||||
->send(story_full_id.get_dialog_id(), {story_full_id.get_story_id()});
|
||||
|
||||
on_delete_story(story_full_id);
|
||||
}
|
||||
|
||||
telegram_api::object_ptr<telegram_api::InputMedia> StoryManager::get_input_media(StoryFullId story_full_id) const {
|
||||
auto dialog_id = story_full_id.get_dialog_id();
|
||||
CHECK(dialog_id.get_type() == DialogType::User);
|
||||
auto r_input_user = td_->contacts_manager_->get_input_user(dialog_id.get_user_id());
|
||||
if (r_input_user.is_error()) {
|
||||
auto input_peer = td_->messages_manager_->get_input_peer(dialog_id, AccessRights::Read);
|
||||
if (input_peer == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
return telegram_api::make_object<telegram_api::inputMediaStory>(r_input_user.move_as_ok(),
|
||||
return telegram_api::make_object<telegram_api::inputMediaStory>(std::move(input_peer),
|
||||
story_full_id.get_story_id().get());
|
||||
}
|
||||
|
||||
|
@ -262,8 +262,8 @@ class StoryManager final : public Actor {
|
||||
std::pair<int32, vector<StoryId>> on_get_stories(DialogId owner_dialog_id, vector<StoryId> &&expected_story_ids,
|
||||
telegram_api::object_ptr<telegram_api::stories_stories> &&stories);
|
||||
|
||||
DialogId on_get_user_stories(DialogId owner_dialog_id,
|
||||
telegram_api::object_ptr<telegram_api::userStories> &&user_stories,
|
||||
DialogId on_get_dialog_stories(DialogId owner_dialog_id,
|
||||
telegram_api::object_ptr<telegram_api::peerStories> &&peer_stories,
|
||||
Promise<Unit> &&promise);
|
||||
|
||||
void on_update_story_id(int64 random_id, StoryId new_story_id, const char *source);
|
||||
@ -417,11 +417,11 @@ class StoryManager final : public Actor {
|
||||
telegram_api::object_ptr<telegram_api::stories_stories> &&stories,
|
||||
Promise<td_api::object_ptr<td_api::stories>> &&promise);
|
||||
|
||||
void on_get_story_archive(telegram_api::object_ptr<telegram_api::stories_stories> &&stories,
|
||||
void on_get_story_archive(DialogId owner_dialog_id, telegram_api::object_ptr<telegram_api::stories_stories> &&stories,
|
||||
Promise<td_api::object_ptr<td_api::stories>> &&promise);
|
||||
|
||||
void on_get_dialog_expiring_stories(DialogId owner_dialog_id,
|
||||
telegram_api::object_ptr<telegram_api::stories_userStories> &&stories,
|
||||
telegram_api::object_ptr<telegram_api::stories_peerStories> &&stories,
|
||||
Promise<td_api::object_ptr<td_api::chatActiveStories>> &&promise);
|
||||
|
||||
static uint64 save_load_dialog_expiring_stories_log_event(DialogId owner_dialog_id);
|
||||
|
@ -851,8 +851,7 @@ bool UpdatesManager::is_acceptable_message(const telegram_api::Message *message_
|
||||
}
|
||||
if (media_id == telegram_api::messageMediaStory::ID) {
|
||||
auto message_media = static_cast<const telegram_api::messageMediaStory *>(message->media_.get());
|
||||
UserId user_id(message_media->user_id_);
|
||||
if (!is_acceptable_user(user_id)) {
|
||||
if (!is_acceptable_peer(message_media->peer_)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -4320,12 +4319,12 @@ void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateAutoSaveSetting
|
||||
}
|
||||
|
||||
void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateStory> update, Promise<Unit> &&promise) {
|
||||
td_->story_manager_->on_get_story(DialogId(UserId(update->user_id_)), std::move(update->story_));
|
||||
td_->story_manager_->on_get_story(DialogId(update->peer_), std::move(update->story_));
|
||||
promise.set_value(Unit());
|
||||
}
|
||||
|
||||
void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateReadStories> update, Promise<Unit> &&promise) {
|
||||
td_->story_manager_->on_update_read_stories(DialogId(UserId(update->user_id_)), StoryId(update->max_id_));
|
||||
td_->story_manager_->on_update_read_stories(DialogId(update->peer_), StoryId(update->max_id_));
|
||||
promise.set_value(Unit());
|
||||
}
|
||||
|
||||
@ -4335,8 +4334,8 @@ void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateStoriesStealthM
|
||||
}
|
||||
|
||||
void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateSentStoryReaction> update, Promise<Unit> &&promise) {
|
||||
td_->story_manager_->on_update_story_chosen_reaction_type(
|
||||
DialogId(UserId(update->user_id_)), StoryId(update->story_id_), ReactionType(update->reaction_));
|
||||
td_->story_manager_->on_update_story_chosen_reaction_type(DialogId(update->peer_), StoryId(update->story_id_),
|
||||
ReactionType(update->reaction_));
|
||||
promise.set_value(Unit());
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
namespace td {
|
||||
|
||||
constexpr int32 MTPROTO_LAYER = 163;
|
||||
constexpr int32 MTPROTO_LAYER = 164;
|
||||
|
||||
enum class Version : int32 {
|
||||
Initial, // 0
|
||||
|
@ -546,7 +546,7 @@ WebPageId WebPagesManager::on_get_web_page(tl_object_ptr<telegram_api::WebPage>
|
||||
}
|
||||
case telegram_api::webPageAttributeStory::ID: {
|
||||
auto attribute = telegram_api::move_object_as<telegram_api::webPageAttributeStory>(attribute_ptr);
|
||||
auto dialog_id = DialogId(UserId(attribute->user_id_));
|
||||
auto dialog_id = DialogId(attribute->peer_);
|
||||
auto story_id = StoryId(attribute->id_);
|
||||
auto story_full_id = StoryFullId(dialog_id, story_id);
|
||||
if (!story_full_id.is_server()) {
|
||||
|
Loading…
Reference in New Issue
Block a user