mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-10 14:16:00 +01:00
Emit <starttls/> as empty element when possible
This commit is contained in:
parent
2915101843
commit
b0277d7e74
1 changed files with 10 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright © 2014-2018 Florian Schmaus
|
||||
* Copyright © 2014-2019 Florian Schmaus
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -52,9 +52,15 @@ public class StartTls implements Nonza {
|
|||
@Override
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this, enclosingNamespace);
|
||||
xml.rightAngleBracket();
|
||||
xml.condEmptyElement(required, "required");
|
||||
xml.closeElement(this);
|
||||
|
||||
if (required) {
|
||||
xml.rightAngleBracket();
|
||||
xml.emptyElement("required");
|
||||
xml.closeElement(this);
|
||||
} else {
|
||||
xml.closeEmptyElement();
|
||||
}
|
||||
|
||||
return xml;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue