Do not hide live location edit date.

GitOrigin-RevId: feb0d2b9b642ee507770cc58a9ad06d37c833957
This commit is contained in:
levlam 2020-03-24 01:33:50 +03:00
parent 487cb20597
commit ca585ad181

View File

@ -4225,8 +4225,12 @@ void MessagesManager::Message::parse(ParserT &parser) {
if (has_reply_markup) { if (has_reply_markup) {
parse(reply_markup, parser); parse(reply_markup, parser);
} }
is_content_secret |= is_content_secret |=
is_secret_message_content(ttl, content->get_type()); // repair is_content_secret for old messages is_secret_message_content(ttl, content->get_type()); // repair is_content_secret for old messages
if (hide_edit_date && content->get_type() == MessageContentType::LiveLocation) {
hide_edit_date = false;
}
} }
template <class StorerT> template <class StorerT>
@ -11301,12 +11305,15 @@ std::pair<DialogId, unique_ptr<MessagesManager::Message>> MessagesManager::creat
edit_date = 0; edit_date = 0;
} }
auto content_type = message_info.content->get_type();
if (hide_edit_date && td_->auth_manager_->is_bot()) { if (hide_edit_date && td_->auth_manager_->is_bot()) {
hide_edit_date = false; hide_edit_date = false;
} }
if (hide_edit_date && content_type == MessageContentType::LiveLocation) {
hide_edit_date = false;
}
int32 ttl = message_info.ttl; int32 ttl = message_info.ttl;
auto content_type = message_info.content->get_type();
bool is_content_secret = is_secret_message_content(ttl, content_type); // should be calculated before TTL is adjusted bool is_content_secret = is_secret_message_content(ttl, content_type); // should be calculated before TTL is adjusted
if (ttl < 0) { if (ttl < 0) {
LOG(ERROR) << "Wrong ttl = " << ttl << " received in " << message_id << " in " << dialog_id; LOG(ERROR) << "Wrong ttl = " << ttl << " received in " << message_id << " in " << dialog_id;