diff --git a/Telegram/SourceFiles/ayu/ayu_settings.cpp b/Telegram/SourceFiles/ayu/ayu_settings.cpp index 435fd2499..a02b625e3 100644 --- a/Telegram/SourceFiles/ayu/ayu_settings.cpp +++ b/Telegram/SourceFiles/ayu/ayu_settings.cpp @@ -23,6 +23,7 @@ namespace AyuSettings { rpl::variable editedMarkReactive; rpl::variable showGhostToggleInDrawerReactive; rpl::variable showPeerIdReactive; + rpl::variable showMessageSecondsReactive; rpl::variable ghostModeEnabled; @@ -64,6 +65,7 @@ namespace AyuSettings { editedMarkReactive = settings->editedMark; showGhostToggleInDrawerReactive = settings->showGhostToggleInDrawer; showPeerIdReactive = settings->showPeerId; + showMessageSecondsReactive = settings->showMessageSeconds; ghostModeEnabled = !settings->sendReadPackets && !settings->sendOnlinePackets; } @@ -160,6 +162,11 @@ namespace AyuSettings { showPeerIdReactive = val; } + void AyuGramSettings::set_showMessageSeconds(bool val) { + showMessageSeconds = val; + showMessageSecondsReactive = val; + } + rpl::producer get_sendReadPacketsReactive() { return sendReadPacketsReactive.value(); } @@ -208,6 +215,10 @@ namespace AyuSettings { return showPeerIdReactive.value(); } + rpl::producer get_showMessageSeconds() { + return showMessageSecondsReactive.value(); + } + rpl::producer get_ghostModeEnabled() { return ghostModeEnabled.value(); } diff --git a/Telegram/SourceFiles/ayu/ayu_settings.h b/Telegram/SourceFiles/ayu/ayu_settings.h index 0e4daf3bc..cd1148d74 100644 --- a/Telegram/SourceFiles/ayu/ayu_settings.h +++ b/Telegram/SourceFiles/ayu/ayu_settings.h @@ -38,6 +38,8 @@ namespace AyuSettings { * showPeerId = 2 means ID shown as for Bot API devs (-100) */ showPeerId = 2; + + showMessageSeconds = false; } QS_SERIALIZABLE @@ -66,6 +68,8 @@ namespace AyuSettings { QS_FIELD(int, showPeerId) + QS_FIELD(bool, showMessageSeconds) + public: void set_sendReadPackets(bool val); void set_sendOnlinePackets(bool val); @@ -83,6 +87,7 @@ namespace AyuSettings { void set_editedMark(QString val); void set_showGhostToggleInDrawer(bool val); void set_showPeerId(int val); + void set_showMessageSeconds(bool val); }; AyuGramSettings &getInstance(); @@ -102,6 +107,7 @@ namespace AyuSettings { rpl::producer get_editedMarkReactive(); rpl::producer get_showGhostToggleInDrawer(); rpl::producer get_showPeerId(); + rpl::producer get_showMessageSeconds(); // computed fields rpl::producer get_ghostModeEnabled(); diff --git a/Telegram/SourceFiles/history/view/history_view_bottom_info.cpp b/Telegram/SourceFiles/history/view/history_view_bottom_info.cpp index d3b810b40..aa7ea108b 100644 --- a/Telegram/SourceFiles/history/view/history_view_bottom_info.cpp +++ b/Telegram/SourceFiles/history/view/history_view_bottom_info.cpp @@ -472,7 +472,7 @@ void BottomInfo::layoutDateText() { const auto prefix = !author.isEmpty() ? (author == settings->deletedMark ? u" "_q : u", "_q) : QString(); const auto date = edited + QLocale().toString( _data.date.time(), - QLocale::ShortFormat); + settings->showMessageSeconds ? QLocale::LongFormat : QLocale::ShortFormat); const auto afterAuthor = prefix + date; const auto afterAuthorWidth = st::msgDateFont->width(afterAuthor); const auto authorWidth = st::msgDateFont->width(author);