From 1dd4e1a767ca15ccb925951daba092b25af06d3d Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 13 Dec 2019 21:05:10 +0300 Subject: [PATCH] Add td_api::updateMessageLiveLocationViewed. GitOrigin-RevId: 2c9d6e1317e6604a23e30efab0dfa21a2e88f01d --- td/generate/scheme/td_api.tl | 15 +++++++++++---- td/generate/scheme/td_api.tlo | Bin 165208 -> 165348 bytes td/telegram/MessagesManager.cpp | 32 ++++++++++++++++++++++++++++++++ td/telegram/MessagesManager.h | 4 ++++ td/telegram/UpdatesManager.cpp | 8 +++++--- td/telegram/UpdatesManager.h | 4 ++-- 6 files changed, 54 insertions(+), 9 deletions(-) diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 4f754d36..7ebd14db 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -2726,6 +2726,10 @@ updateMessageContentOpened chat_id:int53 message_id:int53 = Update; //@description A message with an unread mention was read @chat_id Chat identifier @message_id Message identifier @unread_mention_count The new number of unread mention messages left in the chat updateMessageMentionRead chat_id:int53 message_id:int53 unread_mention_count:int32 = Update; +//@description A message with a live location was viewed. When the update is received, the client is supposed to update the live location +//@chat_id Identifier of the chat with the live location message @message_id Identifier of the message with live location +updateMessageLiveLocationViewed chat_id:int53 message_id:int53 = Update; + //@description A new chat has been loaded/created. This update is guaranteed to come before the chat identifier is returned to the client. The chat field changes will be reported through separate updates @chat The chat updateNewChat chat:chat = Update; @@ -2913,14 +2917,17 @@ updateTermsOfService terms_of_service_id:string terms_of_service:termsOfService //@description List of users nearby has changed. The update is sent only 60 seconds after a successful searchChatsNearby request @users_nearby The new list of users nearby updateUsersNearby users_nearby:vector = Update; -//@description A new incoming inline query; for bots only @id Unique query identifier @sender_user_id Identifier of the user who sent the query @user_location User location, provided by the client; may be null @query Text of the query @offset Offset of the first entry to return +//@description A new incoming inline query; for bots only @id Unique query identifier @sender_user_id Identifier of the user who sent the query @user_location User location, provided by the client; may be null +//@query Text of the query @offset Offset of the first entry to return updateNewInlineQuery id:int64 sender_user_id:int32 user_location:location query:string offset:string = Update; -//@description The user has chosen a result of an inline query; for bots only @sender_user_id Identifier of the user who sent the query @user_location User location, provided by the client; may be null @query Text of the query @result_id Identifier of the chosen result @inline_message_id Identifier of the sent inline message, if known +//@description The user has chosen a result of an inline query; for bots only @sender_user_id Identifier of the user who sent the query @user_location User location, provided by the client; may be null +//@query Text of the query @result_id Identifier of the chosen result @inline_message_id Identifier of the sent inline message, if known updateNewChosenInlineResult sender_user_id:int32 user_location:location query:string result_id:string inline_message_id:string = Update; -//@description A new incoming callback query; for bots only @id Unique query identifier @sender_user_id Identifier of the user who sent the query @chat_id Identifier of the chat where the query was sent -//@message_id Identifier of the message, from which the query originated @chat_instance Identifier that uniquely corresponds to the chat to which the message was sent @payload Query payload +//@description A new incoming callback query; for bots only @id Unique query identifier @sender_user_id Identifier of the user who sent the query +//@chat_id Identifier of the chat where the query was sent @message_id Identifier of the message, from which the query originated +//@chat_instance Identifier that uniquely corresponds to the chat to which the message was sent @payload Query payload updateNewCallbackQuery id:int64 sender_user_id:int32 chat_id:int53 message_id:int53 chat_instance:int64 payload:CallbackQueryPayload = Update; //@description A new incoming callback query from a message sent via a bot; for bots only @id Unique query identifier @sender_user_id Identifier of the user who sent the query @inline_message_id Identifier of the inline message, from which the query originated diff --git a/td/generate/scheme/td_api.tlo b/td/generate/scheme/td_api.tlo index af9480e1038a67683f9a94afb476f299ece44da8..0bfe1531495a8eb67b5bddd07d7515f11d9032d1 100644 GIT binary patch delta 1926 zcmZ8iUuaWj6z{o9N){r!h+x4uv)N&wDT`1r4^hHeSfNoPSl5RR5|?Z(WO`?_Kd>-_ z)eSbaw|;uhZB1>gjhd#~Yg3yT^AJIXLLd6zn1c>7C_~sDGU>y{WGpw|J=b*i>F_(} zJHOxg^L_W}clPz~?V8KIW#Pl=w_5w9Xe1G9>0?K%+w(nc=PLkTM>-0T4tVdlMUTMp zIq-Aq#W`r_mgoR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#T;g!q-B)N=MJSi%p$()9o=3zk*Bte6i)U>eLF)A)Qh zr^#zEJNUvhUDr!r?BLul)FIm13~n)a(wKT=2J=eIfNu4;5|QA*EU=DQ^M-hG77PDt z7NnsZut<&?B)4c`|KxC>^>eny74CByjjN~0!Gm+SfMp{@2wu-oMy%9B(Et7r6M1c6 zo_Q=UK96P!^N@5dAUAlFyxh7#2_fBBu+`$wU;TZ6GcKipvyZ6REZ~uCnALnNPmQ|v zQsbcULUZ9)OCgV%py1_L9`C%fVCw6oBQCwGUgg#Tb%{W^VD_3reply_markup))); } +void MessagesManager::send_update_message_live_location_viewed(FullMessageId full_message_id) { + CHECK(get_message(full_message_id) != nullptr); + send_closure(G()->td(), &Td::send_update, + td_api::make_object(full_message_id.get_dialog_id().get(), + full_message_id.get_message_id().get())); +} + void MessagesManager::send_update_delete_messages(DialogId dialog_id, vector &&message_ids, bool is_permanent, bool from_cache) const { if (message_ids.empty()) { diff --git a/td/telegram/MessagesManager.h b/td/telegram/MessagesManager.h index ea10af5b..3aaf4b4a 100644 --- a/td/telegram/MessagesManager.h +++ b/td/telegram/MessagesManager.h @@ -311,6 +311,8 @@ class MessagesManager : public Actor { void on_update_message_views(FullMessageId full_message_id, int32 views); + void on_update_live_location_viewed(FullMessageId full_message_id); + void on_update_message_content(FullMessageId full_message_id); void on_read_channel_inbox(ChannelId channel_id, MessageId max_message_id, int32 server_unread_count, int32 pts, @@ -1874,6 +1876,8 @@ class MessagesManager : public Actor { void send_update_message_edited(DialogId dialog_id, const Message *m); + void send_update_message_live_location_viewed(FullMessageId full_message_id); + void send_update_delete_messages(DialogId dialog_id, vector &&message_ids, bool is_permanent, bool from_cache) const; diff --git a/td/telegram/UpdatesManager.cpp b/td/telegram/UpdatesManager.cpp index 977dd18d..980cf6a9 100644 --- a/td/telegram/UpdatesManager.cpp +++ b/td/telegram/UpdatesManager.cpp @@ -1952,6 +1952,11 @@ void UpdatesManager::on_update(tl_object_ptr updat std::move(update->difference_)); } +void UpdatesManager::on_update(tl_object_ptr update, bool /*force_apply*/) { + td_->messages_manager_->on_update_live_location_viewed( + {DialogId(update->peer_), MessageId(ServerMessageId(update->msg_id_))}); +} + void UpdatesManager::on_update(tl_object_ptr update, bool /*force_apply*/) { td_->poll_manager_->on_get_poll(PollId(update->poll_id_), std::move(update->poll_), std::move(update->results_)); } @@ -1975,9 +1980,6 @@ void UpdatesManager::on_update(tl_object_ptr update, bool /*force_apply*/) { } -void UpdatesManager::on_update(tl_object_ptr update, bool /*force_apply*/) { -} - void UpdatesManager::on_update(tl_object_ptr update, bool /*force_apply*/) { } diff --git a/td/telegram/UpdatesManager.h b/td/telegram/UpdatesManager.h index 9a50a1c3..1c13fce3 100644 --- a/td/telegram/UpdatesManager.h +++ b/td/telegram/UpdatesManager.h @@ -278,6 +278,8 @@ class UpdatesManager : public Actor { void on_update(tl_object_ptr update, bool /*force_apply*/); void on_update(tl_object_ptr update, bool /*force_apply*/); + void on_update(tl_object_ptr update, bool /*force_apply*/); + void on_update(tl_object_ptr update, bool /*force_apply*/); void on_update(tl_object_ptr update, bool /*force_apply*/); @@ -287,8 +289,6 @@ class UpdatesManager : public Actor { void on_update(tl_object_ptr update, bool /*force_apply*/); - void on_update(tl_object_ptr update, bool /*force_apply*/); - void on_update(tl_object_ptr update, bool /*force_apply*/); };