From f877bf7a46b4166e6bec32d75e736bc8de1825ea Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Wed, 19 Jun 2019 17:52:18 +0300 Subject: [PATCH] Fixed display of views count. --- Telegram/SourceFiles/history/history_message.cpp | 6 ++++-- Telegram/SourceFiles/history/view/history_view_message.cpp | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/history/history_message.cpp b/Telegram/SourceFiles/history/history_message.cpp index 9a01287a9..bbcde42c8 100644 --- a/Telegram/SourceFiles/history/history_message.cpp +++ b/Telegram/SourceFiles/history/history_message.cpp @@ -455,7 +455,9 @@ HistoryMessage::HistoryMessage( int fwdViewsCount = original->viewsCount(); if (fwdViewsCount > 0) { config.viewsCount = fwdViewsCount; - } else if (isPost()) { + } else if (isPost() + || (original->senderOriginal() + && original->senderOriginal()->isChannel())) { config.viewsCount = 1; } @@ -1114,7 +1116,7 @@ void HistoryMessage::setViewsCount(int32 count) { views->_views = count; views->_viewsText = (views->_views > 0) ? Lang::FormatCountToShort(views->_views).string - : QString(); + : QString("1"); views->_viewsWidth = views->_viewsText.isEmpty() ? 0 : st::msgDateFont->width(views->_viewsText); diff --git a/Telegram/SourceFiles/history/view/history_view_message.cpp b/Telegram/SourceFiles/history/view/history_view_message.cpp index 21ed2c749..2bd7e8dd7 100644 --- a/Telegram/SourceFiles/history/view/history_view_message.cpp +++ b/Telegram/SourceFiles/history/view/history_view_message.cpp @@ -1806,7 +1806,7 @@ void Message::initTime() { if (const auto views = item->Get()) { views->_viewsText = (views->_views > 0) ? Lang::FormatCountToShort(views->_views).string - : QString(); + : QString("1"); views->_viewsWidth = views->_viewsText.isEmpty() ? 0 : st::msgDateFont->width(views->_viewsText);