2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 22:46:10 +00:00

Display channels promoted by proxy on top.

This commit is contained in:
John Preston
2018-05-11 17:03:53 +03:00
parent df9ec4b466
commit d3f85b4c4e
25 changed files with 392 additions and 387 deletions

View File

@@ -2134,6 +2134,15 @@ void History::updateChatListExistence() {
}
}
bool History::useProxyPromotion() const {
if (!isProxyPromoted()) {
return false;
} else if (const auto channel = peer->asChannel()) {
return !isPinnedDialog() && !channel->amIn();
}
return false;
}
bool History::shouldBeInChatList() const {
if (peer->migrateTo()) {
return false;
@@ -2141,7 +2150,7 @@ bool History::shouldBeInChatList() const {
return true;
} else if (const auto channel = peer->asChannel()) {
if (!channel->amIn()) {
return false;
return isProxyPromoted();
} else if (const auto feed = channel->feed()) {
return !feed->needUpdateInChatList();
}
@@ -2474,6 +2483,12 @@ void History::checkJoinedMessage(bool createUnread) {
}
}
void History::removeJoinedMessage() {
if (_joinedMessage) {
base::take(_joinedMessage)->destroy();
}
}
bool History::isEmpty() const {
return blocks.empty();
}