Skip to content

Commit

Permalink
HistoryItem: enable pins for channel messages
Browse files Browse the repository at this point in the history
Now we can pin and unpin channel messages.

This commit is based on upstream commit
telegramdesktop/tdesktop@75d8d01

Related to #8, #114.
  • Loading branch information
leha-bot committed Sep 17, 2018
1 parent b2b6bdc commit c00430b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Telegram/SourceFiles/history/history_item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c00430b

Please sign in to comment.