mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-22 14:22:05 +01:00
Use XmlStringBuilder in PubSub's SubscribeExtension
This commit is contained in:
parent
9c0da3ed07
commit
fda9408cf3
1 changed files with 9 additions and 14 deletions
|
@ -16,6 +16,9 @@
|
||||||
*/
|
*/
|
||||||
package org.jivesoftware.smackx.pubsub;
|
package org.jivesoftware.smackx.pubsub;
|
||||||
|
|
||||||
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
|
import org.jivesoftware.smack.util.XmlStringBuilder;
|
||||||
|
|
||||||
import org.jxmpp.jid.Jid;
|
import org.jxmpp.jid.Jid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -41,19 +44,11 @@ public class SubscribeExtension extends NodeExtension {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
public XmlStringBuilder toXML(XmlEnvironment xmlEnvironment) {
|
||||||
StringBuilder builder = new StringBuilder("<");
|
XmlStringBuilder xml = new XmlStringBuilder(this, xmlEnvironment);
|
||||||
builder.append(getElementName());
|
xml.optAttribute("node", getNode());
|
||||||
|
xml.attribute("jid", getJid());
|
||||||
if (getNode() != null) {
|
xml.closeEmptyElement();
|
||||||
builder.append(" node='");
|
return xml;
|
||||||
builder.append(getNode());
|
|
||||||
builder.append('\'');
|
|
||||||
}
|
|
||||||
builder.append(" jid='");
|
|
||||||
builder.append(getJid());
|
|
||||||
builder.append("'/>");
|
|
||||||
|
|
||||||
return builder.toString();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue