diff options
Diffstat (limited to 'filamento/src')
| -rw-r--r-- | filamento/src/chat.rs | 4 | ||||
| -rw-r--r-- | filamento/src/logic/process_stanza.rs | 1 | ||||
| -rw-r--r-- | filamento/src/roster.rs | 2 | ||||
| -rw-r--r-- | filamento/src/user.rs | 1 | 
4 files changed, 7 insertions, 1 deletions
| diff --git a/filamento/src/chat.rs b/filamento/src/chat.rs index 936613e..bb0793f 100644 --- a/filamento/src/chat.rs +++ b/filamento/src/chat.rs @@ -1,13 +1,14 @@  use chrono::{DateTime, Utc};  use jid::JID;  use rusqlite::{ -    types::{FromSql, ToSqlOutput, Value},      ToSql, +    types::{FromSql, ToSqlOutput, Value},  };  use uuid::Uuid;  #[derive(Debug, Clone, PartialEq, Eq)]  #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] +#[cfg_attr(feature = "reactive_stores", derive(reactive_stores::Store))]  pub struct Message {      pub id: Uuid,      // does not contain full user information @@ -78,6 +79,7 @@ pub struct Body {  #[derive(Debug, Clone, PartialEq, Eq)]  #[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 have_chatted: bool, diff --git a/filamento/src/logic/process_stanza.rs b/filamento/src/logic/process_stanza.rs index a5d40b2..81c3b1f 100644 --- a/filamento/src/logic/process_stanza.rs +++ b/filamento/src/logic/process_stanza.rs @@ -77,6 +77,7 @@ pub async fn recv_message<Fs: FileStore + Clone>(                  },                  delivery: None,              }; +            // TODO: process message type="error"              // save the message to the database              match logic.db().upsert_chat_and_user(&from).await { diff --git a/filamento/src/roster.rs b/filamento/src/roster.rs index 8f77086..284e2b8 100644 --- a/filamento/src/roster.rs +++ b/filamento/src/roster.rs @@ -12,6 +12,7 @@ pub struct ContactUpdate {  }  #[derive(Debug, Clone, PartialEq, Eq)] +#[cfg_attr(feature = "reactive_stores", derive(reactive_stores::Store))]  pub struct Contact {      // jid is the id used to reference everything, but not the primary key      pub user_jid: JID, @@ -21,6 +22,7 @@ pub struct Contact {      // TODO: avatar, nickname      /// nickname picked by contact      // nickname: Option<String>, +    #[cfg_attr(feature = "reactive_stores", store(key: String = |group| group.clone()))]      pub groups: HashSet<String>,  } diff --git a/filamento/src/user.rs b/filamento/src/user.rs index f19a4ad..f30933c 100644 --- a/filamento/src/user.rs +++ b/filamento/src/user.rs @@ -2,6 +2,7 @@ use jid::JID;  #[derive(Debug, Clone, PartialEq, Eq)]  #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] +#[cfg_attr(feature = "reactive_stores", derive(reactive_stores::Store))]  pub struct User {      pub jid: JID,      pub nick: Option<String>, | 
