From 362a716150e40c4fb7a11a7487fb618a2cd25a4e Mon Sep 17 00:00:00 2001 From: cel 🌸 Date: Thu, 3 Apr 2025 09:46:24 +0100 Subject: feat(filamento): caps 2.0 helper functions --- filamento/src/disco.rs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'filamento/src/disco.rs') 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, - features: Vec, - identities: Vec, + pub node: Option, + pub features: Vec, + pub identities: Vec, } impl From for Info { @@ -16,7 +16,7 @@ impl From 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 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 for info::Query { node: value.node, features, identities, + extensions: Vec::new(), } } } @@ -108,7 +109,7 @@ impl From 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, - category: Category, + pub name: Option, + pub category: Category, } impl From for Identity { @@ -1086,6 +1087,7 @@ mod identity { category: value.category.to_string(), name: value.name, r#type: value.category.r#type(), + lang: None, } } } -- cgit