2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Update color index caches on palette change.

This commit is contained in:
John Preston
2023-10-23 21:29:18 +04:00
parent 4709e11e46
commit 60fb5fdaf0
22 changed files with 148 additions and 72 deletions

View File

@@ -627,6 +627,13 @@ bool PeerData::changeColorIndex(
: clearColorIndex();
}
bool PeerData::changeBackgroundEmoji(
const tl::conditional<MTPlong> &cloudBackgroundEmoji) {
return changeBackgroundEmoji(cloudBackgroundEmoji
? cloudBackgroundEmoji->v
: DocumentId());
}
void PeerData::fillNames() {
_nameWords.clear();
_nameFirstLetters.clear();
@@ -862,6 +869,13 @@ bool PeerData::clearColorIndex() {
return true;
}
bool PeerData::changeBackgroundEmoji(uint64 id) {
if (_backgroundEmojiId == id) {
return false;
}
_backgroundEmojiId = id;
return true;
}
bool PeerData::isSelf() const {
if (const auto user = asUser()) {
return (user->flags() & UserDataFlag::Self);