diff --git a/Telegram/SourceFiles/history/view/history_view_bottom_info.cpp b/Telegram/SourceFiles/history/view/history_view_bottom_info.cpp index 043ea3719b..ecbe17c3a4 100644 --- a/Telegram/SourceFiles/history/view/history_view_bottom_info.cpp +++ b/Telegram/SourceFiles/history/view/history_view_bottom_info.cpp @@ -21,6 +21,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "history/view/media/history_view_media.h" #include "history/view/history_view_message.h" #include "history/view/history_view_cursor_state.h" +#include "base/unixtime.h" #include "chat_helpers/emoji_interactions.h" #include "core/click_handler_types.h" #include "main/main_session.h" @@ -415,9 +416,9 @@ void BottomInfo::layoutDateText() { : QString(); const auto author = _data.author; const auto prefix = !author.isEmpty() ? u", "_q : QString(); - const auto date = edited + QLocale().toString( - _data.date.time(), - QLocale::ShortFormat); + const auto date = edited + ((_data.flags & Data::Flag::ForwardedDate) + ? langDateTime(_data.date) + : QLocale().toString(_data.date.time(), QLocale::ShortFormat)); const auto afterAuthor = prefix + date; const auto afterAuthorWidth = st::msgDateFont->width(afterAuthor); const auto authorWidth = st::msgDateFont->width(author); @@ -615,6 +616,13 @@ BottomInfo::Data BottomInfoDataFromMessage(not_null message) { if (item->awaitingVideoProcessing()) { result.flags |= Flag::EstimateDate; } + if (forwarded + && forwarded->savedFromPeer + && forwarded->savedFromMsgId + && (!item->externalReply())) { + result.date = base::unixtime::parse(forwarded->originalDate); + result.flags |= Flag::ForwardedDate; + } // We don't want to pass and update it in Data for now. //if (item->unread()) { // result.flags |= Flag::Unread; diff --git a/Telegram/SourceFiles/history/view/history_view_bottom_info.h b/Telegram/SourceFiles/history/view/history_view_bottom_info.h index 7d62a8eb40..b51a5c84d6 100644 --- a/Telegram/SourceFiles/history/view/history_view_bottom_info.h +++ b/Telegram/SourceFiles/history/view/history_view_bottom_info.h @@ -42,6 +42,7 @@ public: Imported = 0x040, Shortcut = 0x080, EstimateDate = 0x100, + ForwardedDate = 0x200, //Unread, // We don't want to pass and update it in Date for now. }; friend inline constexpr bool is_flag_type(Flag) { return true; };