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:
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user