diff options
author | Tiramify (A.K. Daniel) <94789999+TiranexDev@users.noreply.github.com> | 2023-10-25 04:35:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-25 02:35:54 +0000 |
commit | 163749e607c0921e8a4f043807af57ea7c8202ea (patch) | |
tree | 248f751a0209b11e545f0118437851bd695218de /src/components/chatlist.cpp | |
parent | 9a5e820f6d781fe003b5a8111906f9a3519bad2b (diff) | |
download | abaddon-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/components/chatlist.cpp')
-rw-r--r-- | src/components/chatlist.cpp | 11 |
1 files changed, 9 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) { |