From cb025b3aa8efb72406927e4e570ac125a76f40cb Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 12 May 2016 19:55:45 +0300 Subject: [PATCH] Fixed access hash storing in EntityInTextMentionName. Editing message timer is shown for the last five minutes. --- Telegram/SourceFiles/historywidget.cpp | 2 +- Telegram/SourceFiles/ui/text/text_entity.cpp | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 85a9ac085ba387..0d1a57f357e02d 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -8190,7 +8190,7 @@ void HistoryWidget::drawField(Painter &p, const QRect &rect) { namespace { -constexpr int DisplayEditTimeWarningMs = 900 * 1000; +constexpr int DisplayEditTimeWarningMs = 300 * 1000; constexpr int FullDayInMs = 86400 * 1000; } // namespace diff --git a/Telegram/SourceFiles/ui/text/text_entity.cpp b/Telegram/SourceFiles/ui/text/text_entity.cpp index d3a79d03033a09..5835f8bbbf68ca 100644 --- a/Telegram/SourceFiles/ui/text/text_entity.cpp +++ b/Telegram/SourceFiles/ui/text/text_entity.cpp @@ -1363,7 +1363,14 @@ EntitiesInText entitiesFromMTP(const QVector &entities) { case mtpc_messageEntityEmail: { const auto &d(entity.c_messageEntityEmail()); result.push_back(EntityInText(EntityInTextEmail, d.voffset.v, d.vlength.v)); } break; case mtpc_messageEntityHashtag: { const auto &d(entity.c_messageEntityHashtag()); result.push_back(EntityInText(EntityInTextHashtag, d.voffset.v, d.vlength.v)); } break; case mtpc_messageEntityMention: { const auto &d(entity.c_messageEntityMention()); result.push_back(EntityInText(EntityInTextMention, d.voffset.v, d.vlength.v)); } break; - case mtpc_messageEntityMentionName: { const auto &d(entity.c_messageEntityMentionName()); result.push_back(EntityInText(EntityInTextMentionName, d.voffset.v, d.vlength.v, QString::number(d.vuser_id.v))); } break; + case mtpc_messageEntityMentionName: { + const auto &d(entity.c_messageEntityMentionName()); + auto data = QString::number(d.vuser_id.v); + if (auto user = App::userLoaded(peerFromUser(d.vuser_id))) { + data += '.' + QString::number(user->access); + } + result.push_back(EntityInText(EntityInTextMentionName, d.voffset.v, d.vlength.v, data)); + } break; case mtpc_inputMessageEntityMentionName: { const auto &d(entity.c_inputMessageEntityMentionName()); auto data = ([&d]() -> QString {