aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/conversation_selector
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2025-11-14 14:48:25 -0600
committerfiaxh <git@lightrise.org>2025-11-14 14:48:25 -0600
commit1ede8ade12f26cf39d29d5c616bd28693d677e09 (patch)
treedc0bb08cd95c1b47291e48766dfd3fbd7acbaf40 /main/src/ui/conversation_selector
parent9f02aba799e07ad2ab587334fe59c577e5d4605d (diff)
Add support for message moderation and retraction
Diffstat (limited to 'main/src/ui/conversation_selector')
-rw-r--r--main/src/ui/conversation_selector/conversation_selector_row.vala14
1 files changed, 12 insertions, 2 deletions
diff --git a/main/src/ui/conversation_selector/conversation_selector_row.vala b/main/src/ui/conversation_selector/conversation_selector_row.vala
index a0e8b11b..7410937a 100644
--- a/main/src/ui/conversation_selector/conversation_selector_row.vala
+++ b/main/src/ui/conversation_selector/conversation_selector_row.vala
@@ -77,6 +77,11 @@ public class ConversationSelectorRow : ListBoxRow {
content_item_received(item);
}
});
+ stream_interactor.get_module(MessageDeletion.IDENTITY).item_deleted.connect((item) => {
+ if (last_content_item != null && last_content_item.id == item.id) {
+ content_item_received(item);
+ }
+ });
last_content_item = stream_interactor.get_module(ContentItemStore.IDENTITY).get_latest(conversation);
@@ -161,8 +166,13 @@ public class ConversationSelectorRow : ListBoxRow {
nick_label.label += ": ";
}
- change_label_attribute(message_label, attr_style_new(Pango.Style.NORMAL));
- message_label.label = Util.summarize_whitespaces_to_space(body);
+ if (message_item.message.body == "") {
+ change_label_attribute(message_label, attr_style_new(Pango.Style.ITALIC));
+ message_label.label = _("Message deleted");
+ } else {
+ change_label_attribute(message_label, attr_style_new(Pango.Style.NORMAL));
+ message_label.label = Util.summarize_whitespaces_to_space(body);
+ }
break;
case FileItem.TYPE: