arcanegram/patches/feature/streamer-mode-style.patch
devilreef 37d80588b7
fix(patches): streamer mode dialog list anonymization
- drop streamer-mode-online: keep real last-seen text per user pref
- add streamer-mode-forum-topic: anonymize ForumTopic::chatListName
  (per-topic seed = channel id ^ rootId so distinct pseudonyms)
- extend streamer-mode-name: public PeerData::noteNameUpdated bumps
  _nameVersion so Entry::_chatListNameText cache rebuilds on toggle
- ag_refresh: walk histories + topics, invalidate chat-list-entry
  message-view cache (HistoryItem::invalidateChatListEntry resets
  MessageView _textCachedFor so sender prefix re-renders)
- streamer-mode-avatar/style: hunk-header line drift only from
  noteNameUpdated insertion above
2026-05-01 17:07:27 +06:00

70 lines
2.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: devilreef <devilreef@femboy.page>
Date: Fri, 1 May 2026 16:03:10 +0600
Subject: [PATCH] streamer mode: strip name color and decoration
---
Telegram/SourceFiles/data/data_peer.cpp | 16 ++++++++++++++++
Telegram/SourceFiles/data/data_peer.h | 4 +---
2 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/Telegram/SourceFiles/data/data_peer.cpp b/Telegram/SourceFiles/data/data_peer.cpp
index 0000000..0000000 100644
--- a/Telegram/SourceFiles/data/data_peer.cpp
+++ b/Telegram/SourceFiles/data/data_peer.cpp
@@ -1444,7 +1444,17 @@ bool PeerData::clearColorIndex() {
return true;
}
+uint8 PeerData::colorIndex() const {
+ if (Arcanegram::Streamer::ShouldAnonymize(this)) {
+ return Arcanegram::Streamer::ForcedColorIndex();
+ }
+ return _colorIndex;
+}
+
DocumentId PeerData::backgroundEmojiId() const {
+ if (Arcanegram::Streamer::ShouldAnonymize(this)) {
+ return DocumentId(0);
+ }
return _backgroundEmojiId;
}
@@ -1505,6 +1515,9 @@ bool PeerData::clearColorProfileIndex() {
}
DocumentId PeerData::profileBackgroundEmojiId() const {
+ if (Arcanegram::Streamer::ShouldAnonymize(this)) {
+ return DocumentId(0);
+ }
return _profileBackgroundEmojiId;
}
@@ -1530,6 +1543,9 @@ void PeerData::setEmojiStatus(EmojiStatusId emojiStatusId, TimeId until) {
}
EmojiStatusId PeerData::emojiStatusId() const {
+ if (Arcanegram::Streamer::ShouldAnonymize(this)) {
+ return EmojiStatusId();
+ }
return _emojiStatusId;
}
diff --git a/Telegram/SourceFiles/data/data_peer.h b/Telegram/SourceFiles/data/data_peer.h
index 0000000..0000000 100644
--- a/Telegram/SourceFiles/data/data_peer.h
+++ b/Telegram/SourceFiles/data/data_peer.h
@@ -215,9 +215,7 @@ public:
[[nodiscard]] Main::Session &session() const;
[[nodiscard]] Main::Account &account() const;
- [[nodiscard]] uint8 colorIndex() const {
- return _colorIndex;
- }
+ [[nodiscard]] uint8 colorIndex() const;
[[nodiscard]] auto colorCollectible() const
-> const std::shared_ptr<Ui::ColorCollectible> & {
return _colorCollectible;
--
2.52.0.windows.1