From c00430b9a72b10175528f60ddc57faf6825c8769 Mon Sep 17 00:00:00 2001 From: leha-bot Date: Mon, 17 Sep 2018 04:53:15 +0300 Subject: [PATCH] HistoryItem: enable pins for channel messages Now we can pin and unpin channel messages. This commit is based on upstream commit https://github.com/telegramdesktop/tdesktop/commit/75d8d01b1754e4f9c6ffc601848455bda9c4516d Related to #8, #114. --- Telegram/SourceFiles/history/history_item.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/history/history_item.cpp b/Telegram/SourceFiles/history/history_item.cpp index 7ac0b342b..fa6d27748 100644 --- a/Telegram/SourceFiles/history/history_item.cpp +++ b/Telegram/SourceFiles/history/history_item.cpp @@ -823,10 +823,10 @@ void HistoryItem::setId(MsgId newId) { } bool HistoryItem::canPin() const { - if (id < 0 || !_history->peer->isMegagroup() || !toHistoryMessage()) { + if (id < 0 || !toHistoryMessage()) { return false; } - if (auto channel = _history->peer->asMegagroup()) { + if (auto channel = _history->peer->asChannel()) { return channel->canPinMessages(); } return false;