diff --git a/src/jingle.rs b/src/jingle.rs index 224bb543..ece7fa02 100644 --- a/src/jingle.rs +++ b/src/jingle.rs @@ -43,11 +43,13 @@ generate_attribute!(Senders, "senders", { Responder => "responder", }, Default = Both); +generate_id!(ContentId); + #[derive(Debug, Clone)] pub struct Content { pub creator: Creator, pub disposition: String, // TODO: the list of values is defined, use an enum! - pub name: String, + pub name: ContentId, pub senders: Senders, pub description: Option, pub transport: Option, @@ -353,7 +355,7 @@ mod tests { let elem: Element = "".parse().unwrap(); let jingle = Jingle::try_from(elem).unwrap(); assert_eq!(jingle.contents[0].creator, Creator::Initiator); - assert_eq!(jingle.contents[0].name, "coucou"); + assert_eq!(jingle.contents[0].name, ContentId(String::from("coucou"))); assert_eq!(jingle.contents[0].senders, Senders::Both); assert_eq!(jingle.contents[0].disposition, "session");