aboutsummaryrefslogtreecommitdiffstats
path: root/filamento/src/logic/online.rs
diff options
context:
space:
mode:
authorLibravatar cel 🌸 <cel@bunny.garden>2025-04-11 06:07:37 +0100
committerLibravatar cel 🌸 <cel@bunny.garden>2025-04-11 06:07:37 +0100
commit76b148011e5c974ab20466d873f11c2c460c9351 (patch)
tree8dc9b3da249715d3ebe29c5c2e9366480d416768 /filamento/src/logic/online.rs
parente49b4e5ea59079fdf047d3d2eb63ddb895c3b0eb (diff)
downloadluz-76b148011e5c974ab20466d873f11c2c460c9351.tar.gz
luz-76b148011e5c974ab20466d873f11c2c460c9351.tar.bz2
luz-76b148011e5c974ab20466d873f11c2c460c9351.zip
feat(filamento): return from: `User` with `Message` on new message
Diffstat (limited to 'filamento/src/logic/online.rs')
-rw-r--r--filamento/src/logic/online.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/filamento/src/logic/online.rs b/filamento/src/logic/online.rs
index d5242e0..9e90676 100644
--- a/filamento/src/logic/online.rs
+++ b/filamento/src/logic/online.rs
@@ -482,12 +482,26 @@ pub async fn handle_send_message<Fs: FileStore + Clone>(logic: &ClientLogic<Fs>,
.await;
}
+ let from = match logic.db().read_user(logic.bare_jid.clone()).await {
+ Ok(u) => u,
+ Err(e) => {
+ error!("{}", e);
+ User {
+ jid: logic.bare_jid.clone(),
+ nick: None,
+ avatar: None,
+ cached_status_message: None,
+ }
+ },
+ };
+
// tell the client a message is being sent
logic
.update_sender()
.send(UpdateMessage::Message {
to: jid.as_bare(),
message,
+ from,
})
.await;