From 24ae2ffd73e8973f31ac3692c224d7dd0e4dfb36 Mon Sep 17 00:00:00 2001 From: O01eg Date: Wed, 10 Jun 2026 21:24:24 +0000 Subject: [PATCH] xmpp-parsers: Add 'approved' attribute to roster item --- parsers/ChangeLog | 1 + parsers/src/roster.rs | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/parsers/ChangeLog b/parsers/ChangeLog index ca69c307..f5b167fe 100644 --- a/parsers/ChangeLog +++ b/parsers/ChangeLog @@ -33,6 +33,7 @@ XXXX-YY-ZZ RELEASER - jingle_rtp::Description gained a bandwidth child. - Fix cargo test for the disable-validation and component features. - Structs of the bind module now have accessible inner pieces (!675). + - Add 'approved' field to roster item (!683). Version 0.22.0: 2025-10-28 pep diff --git a/parsers/src/roster.rs b/parsers/src/roster.rs index b3d6640f..94e1191d 100644 --- a/parsers/src/roster.rs +++ b/parsers/src/roster.rs @@ -71,6 +71,10 @@ pub struct Item { /// Groups this contact is part of. #[xml(child(n = ..))] pub groups: Vec, + + /// Subscription pre-approval + #[xml(attribute(default))] + pub approved: Option, } /// The contact list of the user. @@ -158,6 +162,7 @@ mod tests { MyBuddies @@ -175,6 +180,7 @@ mod tests { assert_eq!(roster.items[0].name, Some(String::from("Romeo"))); assert_eq!(roster.items[0].subscription, Subscription::Both); assert_eq!(roster.items[0].ask, Ask::None); + assert_eq!(roster.items[0].approved, None); assert_eq!( roster.items[0].groups, vec!(Group::from_str("Friends").unwrap()) @@ -187,6 +193,7 @@ mod tests { assert_eq!(roster.items[3].name, Some(String::from("MyContact"))); assert_eq!(roster.items[3].subscription, Subscription::None); assert_eq!(roster.items[3].ask, Ask::Subscribe); + assert_eq!(roster.items[3].approved, Some(true)); assert_eq!( roster.items[3].groups, vec!(Group::from_str("MyBuddies").unwrap())