summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTiramify (A.K. Daniel) <94789999+TiranexDev@users.noreply.github.com>2023-10-25 04:35:54 +0200
committerGitHub <noreply@github.com>2023-10-25 02:35:54 +0000
commit163749e607c0921e8a4f043807af57ea7c8202ea (patch)
tree248f751a0209b11e545f0118437851bd695218de /src
parent9a5e820f6d781fe003b5a8111906f9a3519bad2b (diff)
downloadabaddon-portaudio-163749e607c0921e8a4f043807af57ea7c8202ea.tar.gz
abaddon-portaudio-163749e607c0921e8a4f043807af57ea7c8202ea.zip
feat: `show_deleted_indicator` (#237)
* show_deleted_messages * Update README.md --------- Co-authored-by: ouwou <26526779+ouwou@users.noreply.github.com>
Diffstat (limited to 'src')
-rw-r--r--src/components/chatlist.cpp11
-rw-r--r--src/settings.cpp2
-rw-r--r--src/settings.hpp1
3 files changed, 12 insertions, 2 deletions
diff --git a/src/components/chatlist.cpp b/src/components/chatlist.cpp
index 4dde8a3..a656a43 100644
--- a/src/components/chatlist.cpp
+++ b/src/components/chatlist.cpp
@@ -187,8 +187,15 @@ void ChatList::DeleteMessage(Snowflake id) {
if (widget == m_id_to_widget.end()) return;
auto *x = dynamic_cast<ChatMessageItemContainer *>(widget->second);
- if (x != nullptr)
- x->UpdateAttributes();
+
+ if (x != nullptr) {
+ if (Abaddon::Get().GetSettings().ShowDeletedIndicator) {
+ x->UpdateAttributes();
+ } else {
+ RemoveMessageAndHeader(x);
+ m_id_to_widget.erase(id);
+ }
+ }
}
void ChatList::RefetchMessage(Snowflake id) {
diff --git a/src/settings.cpp b/src/settings.cpp
index f910ff7..c824a34 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -63,6 +63,7 @@ void SettingsManager::ReadSettings() {
SMBOOL("gui", "unreads", Unreads);
SMBOOL("gui", "alt_menu", AltMenu);
SMBOOL("gui", "hide_to_tray", HideToTray);
+ SMBOOL("gui", "show_deleted_indicator", ShowDeletedIndicator);
SMFLT("gui", "font_scale", FontScale);
SMINT("http", "concurrent", CacheHTTPConcurrency);
SMSTR("http", "user_agent", UserAgent);
@@ -153,6 +154,7 @@ void SettingsManager::Close() {
SMBOOL("gui", "unreads", Unreads);
SMBOOL("gui", "alt_menu", AltMenu);
SMBOOL("gui", "hide_to_tray", HideToTray);
+ SMBOOL("gui", "show_deleted_indicator", ShowDeletedIndicator);
SMFLT("gui", "font_scale", FontScale);
SMINT("http", "concurrent", CacheHTTPConcurrency);
SMSTR("http", "user_agent", UserAgent);
diff --git a/src/settings.hpp b/src/settings.hpp
index 7c6368f..037233b 100644
--- a/src/settings.hpp
+++ b/src/settings.hpp
@@ -30,6 +30,7 @@ public:
bool Unreads { true };
bool AltMenu { false };
bool HideToTray { false };
+ bool ShowDeletedIndicator { true };
double FontScale { -1.0 };
// [http]