mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-04-01 23:00:58 +00:00
Fixed display of views count.
This commit is contained in:
parent
a0171cb144
commit
f877bf7a46
@ -455,7 +455,9 @@ HistoryMessage::HistoryMessage(
|
|||||||
int fwdViewsCount = original->viewsCount();
|
int fwdViewsCount = original->viewsCount();
|
||||||
if (fwdViewsCount > 0) {
|
if (fwdViewsCount > 0) {
|
||||||
config.viewsCount = fwdViewsCount;
|
config.viewsCount = fwdViewsCount;
|
||||||
} else if (isPost()) {
|
} else if (isPost()
|
||||||
|
|| (original->senderOriginal()
|
||||||
|
&& original->senderOriginal()->isChannel())) {
|
||||||
config.viewsCount = 1;
|
config.viewsCount = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1114,7 +1116,7 @@ void HistoryMessage::setViewsCount(int32 count) {
|
|||||||
views->_views = count;
|
views->_views = count;
|
||||||
views->_viewsText = (views->_views > 0)
|
views->_viewsText = (views->_views > 0)
|
||||||
? Lang::FormatCountToShort(views->_views).string
|
? Lang::FormatCountToShort(views->_views).string
|
||||||
: QString();
|
: QString("1");
|
||||||
views->_viewsWidth = views->_viewsText.isEmpty()
|
views->_viewsWidth = views->_viewsText.isEmpty()
|
||||||
? 0
|
? 0
|
||||||
: st::msgDateFont->width(views->_viewsText);
|
: st::msgDateFont->width(views->_viewsText);
|
||||||
|
@ -1806,7 +1806,7 @@ void Message::initTime() {
|
|||||||
if (const auto views = item->Get<HistoryMessageViews>()) {
|
if (const auto views = item->Get<HistoryMessageViews>()) {
|
||||||
views->_viewsText = (views->_views > 0)
|
views->_viewsText = (views->_views > 0)
|
||||||
? Lang::FormatCountToShort(views->_views).string
|
? Lang::FormatCountToShort(views->_views).string
|
||||||
: QString();
|
: QString("1");
|
||||||
views->_viewsWidth = views->_viewsText.isEmpty()
|
views->_viewsWidth = views->_viewsText.isEmpty()
|
||||||
? 0
|
? 0
|
||||||
: st::msgDateFont->width(views->_viewsText);
|
: st::msgDateFont->width(views->_viewsText);
|
||||||
|
Loading…
Reference in New Issue
Block a user