diff options
Diffstat (limited to 'filamento/src/chat.rs')
-rw-r--r-- | filamento/src/chat.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/filamento/src/chat.rs b/filamento/src/chat.rs index 5f58866..c02654f 100644 --- a/filamento/src/chat.rs +++ b/filamento/src/chat.rs @@ -1,7 +1,7 @@ use std::fmt::{Display, Write}; use chrono::{DateTime, Utc}; -use jid::JID; +use jid::{BareJID, JID}; use rusqlite::{ ToSql, types::{FromSql, ToSqlOutput, Value}, @@ -15,7 +15,7 @@ pub struct Message { pub id: Uuid, // does not contain full user information // bare jid (for now) - pub from: JID, + pub from: BareJID, pub delivery: Option<Delivery>, pub timestamp: DateTime<Utc>, // TODO: originally_from @@ -97,7 +97,7 @@ pub struct Body { #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] #[cfg_attr(feature = "reactive_stores", derive(reactive_stores::Store))] pub struct Chat { - pub correspondent: JID, + pub correspondent: BareJID, pub have_chatted: bool, // pub unread_messages: i32, // pub latest_message: Message, @@ -109,13 +109,13 @@ pub struct Chat { pub enum ChatUpdate {} impl Chat { - pub fn new(correspondent: JID, have_chatted: bool) -> Self { + pub fn new(correspondent: BareJID, have_chatted: bool) -> Self { Self { correspondent, have_chatted, } } - pub fn correspondent(&self) -> &JID { + pub fn correspondent(&self) -> &BareJID { &self.correspondent } } |