diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 2398db550..aedd4dd20 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -6752,6 +6752,33 @@ HistoryMessage::HistoryMessage(History *history, const MTPDmessage &msg) setText(textWithEntities); } +namespace { + +MTPDmessage::Flags newForwardedFlags(PeerData *p, int32 from, HistoryMessage *fwd) { + MTPDmessage::Flags result = newMessageFlags(p) | MTPDmessage::Flag::f_fwd_from; + if (from) { + result |= MTPDmessage::Flag::f_from_id; + } + if (fwd->Has()) { + result |= MTPDmessage::Flag::f_via_bot_id; + } + if (!p->isChannel()) { + if (HistoryMedia *media = fwd->getMedia()) { + if (media->type() == MediaTypeVoiceFile) { + result |= MTPDmessage::Flag::f_media_unread; +// } else if (media->type() == MediaTypeVideo) { +// result |= MTPDmessage::flag_media_unread; + } + } + } + if (fwd->hasViews()) { + result |= MTPDmessage::Flag::f_views; + } + return result; +} + +} // namespace + HistoryMessage::HistoryMessage(History *history, MsgId id, MTPDmessage::Flags flags, QDateTime date, int32 from, HistoryMessage *fwd) : HistoryItem(history, id, newForwardedFlags(history->peer, from, fwd) | flags, date, from) { CreateConfig config; diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index 7a8d8c7cc..50f1fa41b 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -2818,25 +2818,6 @@ inline MTPDmessage::Flags newMessageFlags(PeerData *p) { } return result; } -inline MTPDmessage::Flags newForwardedFlags(PeerData *p, int32 from, HistoryMessage *fwd) { - MTPDmessage::Flags result = newMessageFlags(p); - if (from) { - result |= MTPDmessage::Flag::f_from_id; - } - if (fwd->Has()) { - result |= MTPDmessage::Flag::f_via_bot_id; - } - if (!p->isChannel()) { - if (HistoryMedia *media = fwd->getMedia()) { - if (media->type() == MediaTypeVoiceFile) { - result |= MTPDmessage::Flag::f_media_unread; -// } else if (media->type() == MediaTypeVideo) { -// result |= MTPDmessage::flag_media_unread; - } - } - } - return result; -} struct HistoryServicePinned : public BaseComponent { MsgId msgId = 0; diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 1781e4ced..953bc465f 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -8211,7 +8211,7 @@ void HistoryWidget::paintEditHeader(Painter &p, const QRect &rect, int left, int } else if (editTimeLeft > DisplayEditTimeWarningMs) { updateIn = static_cast(qMin(editTimeLeft - DisplayEditTimeWarningMs, qint64(FullDayInMs))); } else { - updateIn = (editTimeLeft % 1000); + updateIn = static_cast(editTimeLeft % 1000); if (!updateIn) { updateIn = 1000; }