From 45aaf558045404e28f68fbf6a64afeab480c15b4 Mon Sep 17 00:00:00 2001 From: James Magahern Date: Mon, 16 Jun 2025 18:52:58 -0700 Subject: [PATCH] dbus: filter attachment characters here. not ideal... --- kordophoned/src/dbus/server_impl.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kordophoned/src/dbus/server_impl.rs b/kordophoned/src/dbus/server_impl.rs index 8d9fea7..98ff227 100644 --- a/kordophoned/src/dbus/server_impl.rs +++ b/kordophoned/src/dbus/server_impl.rs @@ -127,7 +127,13 @@ impl DbusRepository for ServerImpl { .map(|msg| { let mut map = arg::PropMap::new(); map.insert("id".into(), arg::Variant(Box::new(msg.id))); - map.insert("text".into(), arg::Variant(Box::new(msg.text))); + + // xxx: Remove the attachment placeholder here. + // This is not the ideal place to do this, but once we start using ChatItems instead of IMMessages + // from the server, we shouldn't be seeing these placeholders. + let text = msg.text.replace("\u{FFFC}", ""); + + map.insert("text".into(), arg::Variant(Box::new(text))); map.insert( "date".into(), arg::Variant(Box::new(msg.date.and_utc().timestamp())),