diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index cf814babf..ea05f3a86 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -1708,7 +1708,7 @@ messagePinMessage message_id:int53 = MessageContent; //@description A screenshot of a message in the chat has been taken messageScreenshotTaken = MessageContent; -//@description The TTL (Time To Live) setting messages in a secret chat has been changed @ttl New TTL +//@description The TTL (Time To Live) setting for messages in the chat has been changed @ttl New message TTL setting messageChatSetTtl ttl:int32 = MessageContent; //@description A non-standard action has happened in the chat @text Message text to be shown in the chat diff --git a/td/telegram/MessageContent.cpp b/td/telegram/MessageContent.cpp index f01027987..49fbf5655 100644 --- a/td/telegram/MessageContent.cpp +++ b/td/telegram/MessageContent.cpp @@ -4525,6 +4525,10 @@ unique_ptr get_action_message_content(Td *td, tl_object_ptrflags_ & telegram_api::messageActionPhoneCall::DURATION_MASK) != 0 ? phone_call->duration_ : 0; auto is_video = (phone_call->flags_ & telegram_api::messageActionPhoneCall::VIDEO_MASK) != 0; + if (duration < 0) { + LOG(ERROR) << "Receive invalid " << oneline(to_string(phone_call)); + break; + } return make_unique(phone_call->call_id_, duration, get_call_discard_reason(phone_call->reason_), is_video); } @@ -4622,6 +4626,14 @@ unique_ptr get_action_message_content(Td *td, tl_object_ptr(InputGroupCallId(invite_to_group_call->call_), std::move(user_ids)); } + case telegram_api::messageActionSetMessagesTTL::ID: { + auto set_messages_ttl = move_tl_object_as(action); + if (set_messages_ttl->period_ < 0) { + LOG(ERROR) << "Receive wrong ttl = " << set_messages_ttl->period_; + break; + } + return td::make_unique(set_messages_ttl->period_); + } default: UNREACHABLE(); } diff --git a/td/telegram/UpdatesManager.cpp b/td/telegram/UpdatesManager.cpp index f8fc56630..c3b0382a7 100644 --- a/td/telegram/UpdatesManager.cpp +++ b/td/telegram/UpdatesManager.cpp @@ -608,6 +608,7 @@ bool UpdatesManager::is_acceptable_message(const telegram_api::Message *message_ case telegram_api::messageActionSecureValuesSentMe::ID: case telegram_api::messageActionContactSignUp::ID: case telegram_api::messageActionGroupCall::ID: + case telegram_api::messageActionSetMessagesTTL::ID: break; case telegram_api::messageActionChatCreate::ID: { auto chat_create = static_cast(action);