feat(patches): add toggle to ignore peer chat wallpapers
This commit is contained in:
parent
b3110f2d3b
commit
33e76ccc20
9 changed files with 109 additions and 0 deletions
46
patches/feature/disable-chat-wallpaper.patch
Normal file
46
patches/feature/disable-chat-wallpaper.patch
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: devilreef <devilreef@shino.boo>
|
||||
Date: Wed, 29 Apr 2026 04:27:10 +0600
|
||||
Subject: [PATCH] allow disabling per-peer chat wallpapers
|
||||
|
||||
---
|
||||
Telegram/SourceFiles/window/section_widget.cpp | 16 +++++++++++-----
|
||||
1 file changed, 11 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/Telegram/SourceFiles/window/section_widget.cpp b/Telegram/SourceFiles/window/section_widget.cpp
|
||||
index 0000000..0000000 100644
|
||||
--- a/Telegram/SourceFiles/window/section_widget.cpp
|
||||
+++ b/Telegram/SourceFiles/window/section_widget.cpp
|
||||
@@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#include "window/section_widget.h"
|
||||
|
||||
+#include "arcanegram/features/ag_chat_wallpaper.h"
|
||||
#include "mainwidget.h"
|
||||
#include "mainwindow.h"
|
||||
#include "ui/ui_utility.h"
|
||||
@@ -53,11 +54,16 @@ struct ResolvedPaper {
|
||||
|
||||
[[nodiscard]] rpl::producer<const Data::WallPaper*> PeerWallPaperMapped(
|
||||
not_null<PeerData*> peer) {
|
||||
- return peer->session().changes().peerFlagsValue(
|
||||
- peer,
|
||||
- Data::PeerUpdate::Flag::ChatWallPaper
|
||||
- ) | rpl::map([=]() -> rpl::producer<const Data::WallPaper*> {
|
||||
- return WallPaperResolved(&peer->owner(), peer->wallPaper());
|
||||
+ return rpl::combine(
|
||||
+ peer->session().changes().peerFlagsValue(
|
||||
+ peer,
|
||||
+ Data::PeerUpdate::Flag::ChatWallPaper),
|
||||
+ Arcanegram::ChatWallpaper::DisabledValue()
|
||||
+ ) | rpl::map([=](const auto &, bool disabled)
|
||||
+ -> rpl::producer<const Data::WallPaper*> {
|
||||
+ return WallPaperResolved(
|
||||
+ &peer->owner(),
|
||||
+ disabled ? nullptr : peer->wallPaper());
|
||||
}) | rpl::flatten_latest();
|
||||
}
|
||||
|
||||
--
|
||||
2.52.0.windows.1
|
||||
|
||||
|
|
@ -4,6 +4,8 @@
|
|||
"ag_forwarded_date_label" = "Date";
|
||||
"ag_show_seconds_setting" = "Show seconds in timestamps";
|
||||
"ag_show_seconds_info" = "Display HH:MM:SS instead of HH:MM in message timestamps and tooltips.";
|
||||
"ag_chat_wallpaper_disabled_setting" = "Ignore custom chat wallpapers";
|
||||
"ag_chat_wallpaper_disabled_info" = "Always use your default background; ignore wallpapers set by chats and channels.";
|
||||
"ag_hidden_users_title" = "Hidden users";
|
||||
"ag_hidden_users_info" = "Messages from these users are hidden in every chat.";
|
||||
"ag_hidden_users_empty" = "No hidden users yet. Right-click any avatar to hide its messages.";
|
||||
|
|
|
|||
1
series
1
series
|
|
@ -15,4 +15,5 @@ feature/hidden-users-profile-menu.patch
|
|||
feature/hidden-users-element-hide.patch
|
||||
feature/hidden-users-reactions.patch
|
||||
feature/hidden-users-who-reacted.patch
|
||||
feature/disable-chat-wallpaper.patch
|
||||
misc/branding.patch
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@ PRIVATE
|
|||
features/ag_show_seconds.cpp
|
||||
features/ag_hidden_users.h
|
||||
features/ag_hidden_users.cpp
|
||||
features/ag_chat_wallpaper.h
|
||||
features/ag_chat_wallpaper.cpp
|
||||
ui/ag_settings_widgets.h
|
||||
ui/ag_settings_widgets.cpp
|
||||
ui/ag_settings_main.h
|
||||
|
|
|
|||
|
|
@ -49,4 +49,10 @@ inline auto Stored = Item<QString>("ag_hidden_users", QString());
|
|||
|
||||
} // namespace HiddenUsers
|
||||
|
||||
namespace ChatWallpaper {
|
||||
|
||||
inline auto Disabled = BoolItem("ag_chat_wallpaper_disabled", false);
|
||||
|
||||
} // namespace ChatWallpaper
|
||||
|
||||
} // namespace Arcanegram::Config
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
#include "arcanegram/features/ag_forwarded_header.h"
|
||||
#include "arcanegram/features/ag_show_seconds.h"
|
||||
#include "arcanegram/features/ag_hidden_users.h"
|
||||
#include "arcanegram/features/ag_chat_wallpaper.h"
|
||||
|
||||
namespace Arcanegram::Hooks {
|
||||
|
||||
|
|
@ -10,6 +11,7 @@ void init() {
|
|||
Arcanegram::ForwardedHeader::Init();
|
||||
Arcanegram::Time::Init();
|
||||
Arcanegram::HiddenUsers::Init();
|
||||
Arcanegram::ChatWallpaper::Init();
|
||||
}
|
||||
|
||||
} // namespace Arcanegram::Hooks
|
||||
|
|
|
|||
31
src/cpp/arcanegram/features/ag_chat_wallpaper.cpp
Normal file
31
src/cpp/arcanegram/features/ag_chat_wallpaper.cpp
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#include "arcanegram/features/ag_chat_wallpaper.h"
|
||||
|
||||
#include "arcanegram/ag_config.h"
|
||||
#include "arcanegram/ui/ag_settings_widgets.h"
|
||||
#include "lang/lang_keys.h"
|
||||
|
||||
namespace Arcanegram::ChatWallpaper {
|
||||
|
||||
bool Disabled() {
|
||||
return Config::ChatWallpaper::Disabled.value();
|
||||
}
|
||||
|
||||
rpl::producer<bool> DisabledValue() {
|
||||
return rpl::single(
|
||||
Config::ChatWallpaper::Disabled.value()
|
||||
) | rpl::then(Config::ChatWallpaper::Disabled.changes());
|
||||
}
|
||||
|
||||
void Setup(::Settings::Builder::SectionBuilder &builder) {
|
||||
Arcanegram::Settings::AddBoolRow(
|
||||
builder,
|
||||
u"arcanegram/chat_wallpaper_disabled"_q,
|
||||
tr::ag_chat_wallpaper_disabled_setting(),
|
||||
tr::ag_chat_wallpaper_disabled_info(),
|
||||
Config::ChatWallpaper::Disabled);
|
||||
}
|
||||
|
||||
void Init() {
|
||||
}
|
||||
|
||||
} // namespace Arcanegram::ChatWallpaper
|
||||
17
src/cpp/arcanegram/features/ag_chat_wallpaper.h
Normal file
17
src/cpp/arcanegram/features/ag_chat_wallpaper.h
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#pragma once
|
||||
|
||||
#include <rpl/producer.h>
|
||||
|
||||
namespace Settings::Builder {
|
||||
class SectionBuilder;
|
||||
} // namespace Settings::Builder
|
||||
|
||||
namespace Arcanegram::ChatWallpaper {
|
||||
|
||||
[[nodiscard]] bool Disabled();
|
||||
[[nodiscard]] rpl::producer<bool> DisabledValue();
|
||||
|
||||
void Setup(::Settings::Builder::SectionBuilder &builder);
|
||||
void Init();
|
||||
|
||||
} // namespace Arcanegram::ChatWallpaper
|
||||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include "arcanegram/features/ag_forwarded_header.h"
|
||||
#include "arcanegram/features/ag_show_seconds.h"
|
||||
#include "arcanegram/features/ag_chat_wallpaper.h"
|
||||
#include "arcanegram/ui/ag_hidden_users_settings.h"
|
||||
#include "lang/lang_keys.h"
|
||||
#include "settings/sections/settings_main.h"
|
||||
|
|
@ -32,6 +33,7 @@ private:
|
|||
void BuildContent(SectionBuilder &builder) {
|
||||
Arcanegram::ForwardedHeader::Setup(builder);
|
||||
Arcanegram::Time::Setup(builder);
|
||||
Arcanegram::ChatWallpaper::Setup(builder);
|
||||
Arcanegram::HiddenUsers::Setup(builder);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue