2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-29 05:37:45 +00:00

Show time of service message

This commit is contained in:
RadRussianRus 2020-05-06 04:02:02 +03:00
parent d932e2f04f
commit 19e85616f7

View File

@ -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) {