Excluded ability to display 0 views in channel posts.

This commit is contained in:
23rd 2019-05-03 17:59:42 +03:00 committed by John Preston
parent dcd5aa83da
commit 63a6893fda
2 changed files with 2 additions and 2 deletions

View File

@ -1098,7 +1098,7 @@ void HistoryMessage::setViewsCount(int32 count) {
const auto was = views->_viewsWidth;
views->_views = count;
views->_viewsText = (views->_views >= 0)
views->_viewsText = (views->_views > 0)
? lng_channel_views(lt_count_short, views->_views)
: QString();
views->_viewsWidth = views->_viewsText.isEmpty()

View File

@ -1797,7 +1797,7 @@ void Message::initTime() {
item->_timeWidth = st::msgDateFont->width(item->_timeText);
}
if (const auto views = item->Get<HistoryMessageViews>()) {
views->_viewsText = (views->_views >= 0)
views->_viewsText = (views->_views > 0)
? lng_channel_views(lt_count_short, views->_views)
: QString();
views->_viewsWidth = views->_viewsText.isEmpty()