mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-12-26 04:28:00 +01:00
[jingle] Add empty element optimization for <content/>
This commit is contained in:
parent
ec456399b5
commit
585bcb4dc8
2 changed files with 6 additions and 2 deletions
|
@ -145,6 +145,11 @@ public final class JingleContent implements FullyQualifiedElement {
|
|||
xml.optAttribute(DISPOSITION_ATTRIBUTE_NAME, disposition);
|
||||
xml.attribute(NAME_ATTRIBUTE_NAME, name);
|
||||
xml.optAttribute(SENDERS_ATTRIBUTE_NAME, senders);
|
||||
|
||||
if (description == null && transport == null) {
|
||||
return xml.closeEmptyElement();
|
||||
}
|
||||
|
||||
xml.rightAngleBracket();
|
||||
|
||||
xml.optAppend(description);
|
||||
|
|
|
@ -75,8 +75,7 @@ public class JingleContentTest extends SmackTestSuite {
|
|||
assertEquals(content1.toXML().toString(), builder.build().toXML().toString());
|
||||
|
||||
String xml =
|
||||
"<content xmlns='urn:xmpp:jingle:1' creator='initiator' disposition='session' name='A name' senders='both'>" +
|
||||
"</content>";
|
||||
"<content xmlns='urn:xmpp:jingle:1' creator='initiator' disposition='session' name='A name' senders='both'/>";
|
||||
assertEquals(xml, content1.toXML().toString());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue