From 19e85616f7b10a1560762fd39d51202ce1ee1e71 Mon Sep 17 00:00:00 2001 From: RadRussianRus Date: Wed, 6 May 2020 04:02:02 +0300 Subject: [PATCH] Show time of service message --- Telegram/SourceFiles/history/history_service.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/history/history_service.cpp b/Telegram/SourceFiles/history/history_service.cpp index 4856847d2..7c45e1691 100644 --- a/Telegram/SourceFiles/history/history_service.cpp +++ b/Telegram/SourceFiles/history/history_service.cpp @@ -27,11 +27,19 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "window/window_session_controller.h" #include "storage/storage_shared_media.h" #include "ui/text_options.h" +#include "base/unixtime.h" namespace { constexpr auto kPinnedMessageTextLimit = 16; +QString GenerateServiceTime(TimeId date) { + if (date > 0) { + return qs(" ยท ") + base::unixtime::parse(date).toString(cTimeFormat()); + } + return QString(); +} + } // namespace void HistoryService::setMessageByAction(const MTPmessageAction &action) { @@ -577,7 +585,7 @@ ClickHandlerPtr HistoryService::fromLink() const { void HistoryService::setServiceText(const PreparedText &prepared) { _text.setText( st::serviceTextStyle, - prepared.text, + prepared.text + GenerateServiceTime(date()), Ui::ItemTextServiceOptions()); auto linkIndex = 0; for_const (auto &link, prepared.links) {