From d36d5b29801b4258a99af4e21e1e3e7c39b50c36 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Thu, 2 Oct 2025 10:31:46 +0300 Subject: [PATCH] Added new Changes flag for user notes. --- Telegram/SourceFiles/data/data_changes.h | 33 ++++++++++++------------ Telegram/SourceFiles/data/data_user.cpp | 5 +++- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/Telegram/SourceFiles/data/data_changes.h b/Telegram/SourceFiles/data/data_changes.h index 443d242cb9..51229fffb6 100644 --- a/Telegram/SourceFiles/data/data_changes.h +++ b/Telegram/SourceFiles/data/data_changes.h @@ -100,28 +100,29 @@ struct PeerUpdate { PaysPerMessage = (1ULL << 36), GiftSettings = (1ULL << 37), StarsRating = (1ULL << 38), + ContactNote = (1ULL << 39), // For chats and channels - InviteLinks = (1ULL << 39), - Members = (1ULL << 40), - Admins = (1ULL << 41), - BannedUsers = (1ULL << 42), - Rights = (1ULL << 43), - PendingRequests = (1ULL << 44), - Reactions = (1ULL << 45), + InviteLinks = (1ULL << 40), + Members = (1ULL << 41), + Admins = (1ULL << 42), + BannedUsers = (1ULL << 43), + Rights = (1ULL << 44), + PendingRequests = (1ULL << 45), + Reactions = (1ULL << 46), // For channels - ChannelAmIn = (1ULL << 46), - StickersSet = (1ULL << 47), - EmojiSet = (1ULL << 48), - DiscussionLink = (1ULL << 49), - MonoforumLink = (1ULL << 50), - ChannelLocation = (1ULL << 51), - Slowmode = (1ULL << 52), - GroupCall = (1ULL << 53), + ChannelAmIn = (1ULL << 47), + StickersSet = (1ULL << 48), + EmojiSet = (1ULL << 49), + DiscussionLink = (1ULL << 50), + MonoforumLink = (1ULL << 51), + ChannelLocation = (1ULL << 52), + Slowmode = (1ULL << 53), + GroupCall = (1ULL << 54), // For iteration - LastUsedBit = (1ULL << 53), + LastUsedBit = (1ULL << 54), }; using Flags = base::flags; friend inline constexpr auto is_flag_type(Flag) { return true; } diff --git a/Telegram/SourceFiles/data/data_user.cpp b/Telegram/SourceFiles/data/data_user.cpp index d95ca801d5..8ff011a5cf 100644 --- a/Telegram/SourceFiles/data/data_user.cpp +++ b/Telegram/SourceFiles/data/data_user.cpp @@ -770,7 +770,10 @@ const TextWithEntities &UserData::note() const { } void UserData::setNote(const TextWithEntities ¬e) { - _note = note; + if (_note != note) { + _note = note; + session().changes().peerUpdated(this, UpdateFlag::ContactNote); + } } namespace Data {