diff options
author | 2025-04-03 09:46:24 +0100 | |
---|---|---|
committer | 2025-04-03 09:46:24 +0100 | |
commit | 362a716150e40c4fb7a11a7487fb618a2cd25a4e (patch) | |
tree | f15ad2f6751180a96e8416fdaedea279be13ab68 /filamento/src/disco.rs | |
parent | 9b18e40d8ba5f891e077daa039632f81d5fd2f86 (diff) | |
download | luz-362a716150e40c4fb7a11a7487fb618a2cd25a4e.tar.gz luz-362a716150e40c4fb7a11a7487fb618a2cd25a4e.tar.bz2 luz-362a716150e40c4fb7a11a7487fb618a2cd25a4e.zip |
feat(filamento): caps 2.0 helper functions
Diffstat (limited to 'filamento/src/disco.rs')
-rw-r--r-- | filamento/src/disco.rs | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/filamento/src/disco.rs b/filamento/src/disco.rs index cc48215..580f647 100644 --- a/filamento/src/disco.rs +++ b/filamento/src/disco.rs @@ -6,9 +6,9 @@ pub use identity::Identity; #[derive(Debug, Clone)] pub struct Info { - node: Option<String>, - features: Vec<Feature>, - identities: Vec<Identity>, + pub node: Option<String>, + pub features: Vec<String>, + pub identities: Vec<Identity>, } impl From<info::Query> for Info { @@ -16,7 +16,7 @@ impl From<info::Query> for Info { let features = value .features .into_iter() - .map(|feature| feature.into()) + .map(|feature| feature.var) .collect(); let identities = value .identities @@ -37,7 +37,7 @@ impl From<Info> for info::Query { let features = value .features .into_iter() - .map(|feature| feature.into()) + .map(|feature| info::Feature { var: feature }) .collect(); let identities = value .identities @@ -49,6 +49,7 @@ impl From<Info> for info::Query { node: value.node, features, identities, + extensions: Vec::new(), } } } @@ -108,7 +109,7 @@ impl From<Item> for items::Item { } } -mod feature { +pub mod feature { use stanza::xep_0030::info; // https://xmpp.org/registrar/disco-features.html @@ -1061,13 +1062,13 @@ mod feature { } } -mod identity { +pub mod identity { use stanza::xep_0030::info; #[derive(Debug, Clone)] pub struct Identity { - name: Option<String>, - category: Category, + pub name: Option<String>, + pub category: Category, } impl From<info::Identity> for Identity { @@ -1086,6 +1087,7 @@ mod identity { category: value.category.to_string(), name: value.name, r#type: value.category.r#type(), + lang: None, } } } |