2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Display reply background emoji.

This commit is contained in:
John Preston
2023-10-24 11:47:11 +04:00
parent 60fb5fdaf0
commit 9c23de7f1a
6 changed files with 211 additions and 10 deletions

View File

@@ -627,9 +627,9 @@ bool PeerData::changeColorIndex(
: clearColorIndex();
}
bool PeerData::changeBackgroundEmoji(
bool PeerData::changeBackgroundEmojiId(
const tl::conditional<MTPlong> &cloudBackgroundEmoji) {
return changeBackgroundEmoji(cloudBackgroundEmoji
return changeBackgroundEmojiId(cloudBackgroundEmoji
? cloudBackgroundEmoji->v
: DocumentId());
}
@@ -869,7 +869,11 @@ bool PeerData::clearColorIndex() {
return true;
}
bool PeerData::changeBackgroundEmoji(uint64 id) {
DocumentId PeerData::backgroundEmojiId() const {
return _backgroundEmojiId;
}
bool PeerData::changeBackgroundEmojiId(DocumentId id) {
if (_backgroundEmojiId == id) {
return false;
}

View File

@@ -169,7 +169,8 @@ public:
}
bool changeColorIndex(uint8 index);
bool clearColorIndex();
bool changeBackgroundEmoji(uint64 id);
[[nodiscard]] DocumentId backgroundEmojiId() const;
bool changeBackgroundEmojiId(DocumentId id);
[[nodiscard]] bool isUser() const {
return peerIsUser(id);
@@ -361,7 +362,7 @@ public:
void setSettings(const MTPPeerSettings &data);
bool changeColorIndex(const tl::conditional<MTPint> &cloudColorIndex);
bool changeBackgroundEmoji(
bool changeBackgroundEmojiId(
const tl::conditional<MTPlong> &cloudBackgroundEmoji);
enum class BlockStatus : char {

View File

@@ -711,7 +711,7 @@ not_null<UserData*> Session::processUser(const MTPUser &data) {
flags |= UpdateFlag::Color;
decorationsUpdated = true;
}
if (result->changeBackgroundEmoji(data.vbackground_emoji_id())) {
if (result->changeBackgroundEmojiId(data.vbackground_emoji_id())) {
flags |= UpdateFlag::BackgroundEmoji;
decorationsUpdated = true;
}
@@ -997,7 +997,7 @@ not_null<PeerData*> Session::processChat(const MTPChat &data) {
flags |= UpdateFlag::Color;
decorationsUpdated = true;
}
if (result->changeBackgroundEmoji(data.vbackground_emoji_id())) {
if (result->changeBackgroundEmojiId(data.vbackground_emoji_id())) {
flags |= UpdateFlag::BackgroundEmoji;
decorationsUpdated = true;
}