diff options
author | 2025-06-01 13:31:52 +0100 | |
---|---|---|
committer | 2025-06-01 13:31:52 +0100 | |
commit | c6bdf077b82b30f8228b56702bd3ee71d92b3910 (patch) | |
tree | db12501d5d60906b77b19c1395a522967957c715 /filamento/src/chat.rs | |
parent | c196aecbe7b3b29fbfff9e997478688e6833b7f3 (diff) | |
download | luz-c6bdf077b82b30f8228b56702bd3ee71d92b3910.tar.gz luz-c6bdf077b82b30f8228b56702bd3ee71d92b3910.tar.bz2 luz-c6bdf077b82b30f8228b56702bd3ee71d92b3910.zip |
refactor: utilise new jid type safetyHEADmainjid-refactor
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 } } |