Fix hide_edit_date support.

GitOrigin-RevId: a6875a31b618f527883e8bc205efe8ac96f683b9
This commit is contained in:
levlam 2019-11-22 14:02:18 +03:00
parent f1cc64ec16
commit b00293992e
2 changed files with 8 additions and 2 deletions

View File

@ -10557,7 +10557,8 @@ std::pair<DialogId, unique_ptr<MessagesManager::Message>> MessagesManager::creat
MESSAGE_FLAG_HAS_UNREAD_CONTENT | MESSAGE_FLAG_HAS_REPLY_MARKUP | MESSAGE_FLAG_HAS_ENTITIES | MESSAGE_FLAG_HAS_UNREAD_CONTENT | MESSAGE_FLAG_HAS_REPLY_MARKUP | MESSAGE_FLAG_HAS_ENTITIES |
MESSAGE_FLAG_HAS_FROM_ID | MESSAGE_FLAG_HAS_MEDIA | MESSAGE_FLAG_HAS_VIEWS | MESSAGE_FLAG_IS_SENT_VIA_BOT | MESSAGE_FLAG_HAS_FROM_ID | MESSAGE_FLAG_HAS_MEDIA | MESSAGE_FLAG_HAS_VIEWS | MESSAGE_FLAG_IS_SENT_VIA_BOT |
MESSAGE_FLAG_IS_SILENT | MESSAGE_FLAG_IS_POST | MESSAGE_FLAG_HAS_EDIT_DATE | MESSAGE_FLAG_HAS_AUTHOR_SIGNATURE | MESSAGE_FLAG_IS_SILENT | MESSAGE_FLAG_IS_POST | MESSAGE_FLAG_HAS_EDIT_DATE | MESSAGE_FLAG_HAS_AUTHOR_SIGNATURE |
MESSAGE_FLAG_HAS_MEDIA_ALBUM_ID | MESSAGE_FLAG_IS_LEGACY)) { MESSAGE_FLAG_HAS_MEDIA_ALBUM_ID | MESSAGE_FLAG_IS_FROM_SCHEDULED | MESSAGE_FLAG_IS_LEGACY |
MESSAGE_FLAG_HIDE_EDIT_DATE | MESSAGE_FLAG_IS_RESTRICTED)) {
LOG(ERROR) << "Unsupported message flags = " << flags << " received"; LOG(ERROR) << "Unsupported message flags = " << flags << " received";
} }
@ -10565,6 +10566,7 @@ std::pair<DialogId, unique_ptr<MessagesManager::Message>> MessagesManager::creat
bool is_silent = (flags & MESSAGE_FLAG_IS_SILENT) != 0; bool is_silent = (flags & MESSAGE_FLAG_IS_SILENT) != 0;
bool is_channel_post = (flags & MESSAGE_FLAG_IS_POST) != 0; bool is_channel_post = (flags & MESSAGE_FLAG_IS_POST) != 0;
bool is_legacy = (flags & MESSAGE_FLAG_IS_LEGACY) != 0; bool is_legacy = (flags & MESSAGE_FLAG_IS_LEGACY) != 0;
bool hide_edit_date = (flags & MESSAGE_FLAG_HIDE_EDIT_DATE) != 0;
LOG_IF(ERROR, is_channel_message && dialog_type != DialogType::Channel) LOG_IF(ERROR, is_channel_message && dialog_type != DialogType::Channel)
<< "is_channel_message is true for message received in the " << dialog_id; << "is_channel_message is true for message received in the " << dialog_id;
@ -10662,6 +10664,7 @@ std::pair<DialogId, unique_ptr<MessagesManager::Message>> MessagesManager::creat
(dialog_type == DialogType::Chat || (dialog_type == DialogType::Channel && !is_broadcast_channel(dialog_id))); (dialog_type == DialogType::Chat || (dialog_type == DialogType::Channel && !is_broadcast_channel(dialog_id)));
message->disable_notification = is_silent; message->disable_notification = is_silent;
message->is_content_secret = is_content_secret; message->is_content_secret = is_content_secret;
message->hide_edit_date = hide_edit_date;
message->views = views; message->views = views;
message->legacy_layer = (is_legacy ? MTPROTO_LAYER : 0); message->legacy_layer = (is_legacy ? MTPROTO_LAYER : 0);
message->content = std::move(message_info.content); message->content = std::move(message_info.content);

View File

@ -144,7 +144,10 @@ class MessagesManager : public Actor {
static constexpr int32 MESSAGE_FLAG_HAS_EDIT_DATE = 1 << 15; static constexpr int32 MESSAGE_FLAG_HAS_EDIT_DATE = 1 << 15;
static constexpr int32 MESSAGE_FLAG_HAS_AUTHOR_SIGNATURE = 1 << 16; static constexpr int32 MESSAGE_FLAG_HAS_AUTHOR_SIGNATURE = 1 << 16;
static constexpr int32 MESSAGE_FLAG_HAS_MEDIA_ALBUM_ID = 1 << 17; static constexpr int32 MESSAGE_FLAG_HAS_MEDIA_ALBUM_ID = 1 << 17;
static constexpr int32 MESSAGE_FLAG_IS_FROM_SCHEDULED = 1 << 18;
static constexpr int32 MESSAGE_FLAG_IS_LEGACY = 1 << 19; static constexpr int32 MESSAGE_FLAG_IS_LEGACY = 1 << 19;
static constexpr int32 MESSAGE_FLAG_HIDE_EDIT_DATE = 1 << 21;
static constexpr int32 MESSAGE_FLAG_IS_RESTRICTED = 1 << 22;
static constexpr int32 SEND_MESSAGE_FLAG_IS_REPLY = 1 << 0; static constexpr int32 SEND_MESSAGE_FLAG_IS_REPLY = 1 << 0;
static constexpr int32 SEND_MESSAGE_FLAG_DISABLE_WEB_PAGE_PREVIEW = 1 << 1; static constexpr int32 SEND_MESSAGE_FLAG_DISABLE_WEB_PAGE_PREVIEW = 1 << 1;
@ -876,7 +879,7 @@ class MessagesManager : public Actor {
} }
}; };
// Do not forget to update MessagesManager::update_message when this class is changed // Do not forget to update MessagesManager::update_message and all make_unique<Message> when this class is changed
struct Message { struct Message {
int32 random_y; int32 random_y;