From 2de74b0722fa77d9a8bddecd29f74235257eba3d Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 13 Nov 2023 14:49:12 +0400 Subject: [PATCH] wip colors --- Telegram/SourceFiles/data/data_session.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Telegram/SourceFiles/data/data_session.cpp b/Telegram/SourceFiles/data/data_session.cpp index e31159b2af2d2..0d3cf13c458f2 100644 --- a/Telegram/SourceFiles/data/data_session.cpp +++ b/Telegram/SourceFiles/data/data_session.cpp @@ -1373,6 +1373,20 @@ not_null Session::processPeer(const TLchat &dialog) { session().sendAsPeers().setChosen(result, peerFromSender(*sender)); } + auto decorationsUpdated = false; + if (result->changeColorIndex(data.vaccent_color_id().v)) { + updates |= UpdateFlag::Color; + decorationsUpdated = true; + } + if (result->changeBackgroundEmojiId( + data.vbackground_custom_emoji_id().v)) { + updates |= UpdateFlag::BackgroundEmoji; + decorationsUpdated = true; + } + if (decorationsUpdated && result->isMinimalLoaded()) { + _peerDecorationsUpdated.fire_copy(result); + } + if (!result->isFullLoaded()) { result->setLoadedStatus(PeerData::LoadedStatus::Full); }