Skip to content

Commit

Permalink
Fixed access hash storing in EntityInTextMentionName.
Browse files Browse the repository at this point in the history
Editing message timer is shown for the last five minutes.
  • Loading branch information
john-preston committed May 12, 2016
1 parent 6188aea commit cb025b3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Telegram/SourceFiles/historywidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion Telegram/SourceFiles/ui/text/text_entity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1363,7 +1363,14 @@ EntitiesInText entitiesFromMTP(const QVector<MTPMessageEntity> &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 {
Expand Down

0 comments on commit cb025b3

Please sign in to comment.