2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 22:55:11 +00:00

Support empty group placeholder for creators.

This commit is contained in:
John Preston
2019-01-15 18:13:20 +04:00
parent 2a0b9a44dd
commit 2a5bcd3eec
9 changed files with 131 additions and 11 deletions

View File

@@ -2727,7 +2727,19 @@ bool History::isEmpty() const {
}
bool History::isDisplayedEmpty() const {
return findFirstNonEmpty() == nullptr;
const auto first = findFirstNonEmpty();
if (!first) {
return true;
} else if (!first->data()->isGroupEssential()) {
return false;
} else if (const auto chat = peer->asChat()) {
// For legacy chats we want to show the chat with only first
// message about you creating the group as an empty chat with
// a nice information about the group features.
return chat->amCreator() && (findLastNonEmpty() == first);
} else {
return false;
}
}
auto History::findFirstNonEmpty() const -> Element* {