From 76b148011e5c974ab20466d873f11c2c460c9351 Mon Sep 17 00:00:00 2001 From: cel 🌸 Date: Fri, 11 Apr 2025 06:07:37 +0100 Subject: feat(filamento): return from: `User` with `Message` on new message --- filamento/src/logic/process_stanza.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'filamento/src/logic/process_stanza.rs') diff --git a/filamento/src/logic/process_stanza.rs b/filamento/src/logic/process_stanza.rs index 51e20a4..1a29f70 100644 --- a/filamento/src/logic/process_stanza.rs +++ b/filamento/src/logic/process_stanza.rs @@ -26,6 +26,7 @@ use crate::{ files::FileStore, presence::{Offline, Online, Presence, PresenceType, Show}, roster::Contact, + user::User, }; use super::ClientLogic; @@ -103,11 +104,25 @@ pub async fn recv_message( } }; + let from_user = match logic.db().read_user(from.as_bare()).await { + Ok(u) => u, + Err(e) => { + error!("{}", e); + User { + jid: from.as_bare(), + nick: None, + avatar: None, + cached_status_message: None, + } + } + }; + // update the client with the new message logic .update_sender() .send(UpdateMessage::Message { to: from.as_bare(), + from: from_user, message, }) .await; -- cgit