mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-28 08:22:31 +00:00
Added original date of forwarded messages to bottom message in self.
This commit is contained in:
@@ -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*> 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;
|
||||
|
||||
@@ -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; };
|
||||
|
||||
Reference in New Issue
Block a user