1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-22 06:12:05 +01:00

Fix pubsub options rendering

The exiting code generates an unintentional nested 'options' child element:

```
<iq to='pubsub.example.org' id='FQTHU-126' type='get'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <options node='sinttest-multisubscribe-nodename-13pnc'>
      <options jid='smack-inttest-two-13pnc@example.org'
               node='sinttest-multisubscribe-nodename-13pnc'/>
    </options>
  </pubsub>
</iq>
```

This commit removes the undesired nesting, resulting in:

```
<iq to='pubsub.example.org' id='FQTHU-126' type='get'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <options jid='smack-inttest-two-13pnc@example.org'
             node='sinttest-multisubscribe-nodename-13pnc'/>
  </pubsub>
</iq>
```
This commit is contained in:
Guus der Kinderen 2020-10-06 14:57:25 +02:00 committed by Florian Schmaus
parent 1a9ac238e8
commit 55d7b9d4eb

View file

@ -51,14 +51,9 @@ public class OptionsExtension extends NodeExtension {
@Override @Override
protected void addXml(XmlStringBuilder xml) { protected void addXml(XmlStringBuilder xml) {
xml.rightAngleBracket();
xml.halfOpenElement(getElementName());
xml.attribute("jid", jid); xml.attribute("jid", jid);
xml.optAttribute("node", getNode());
xml.optAttribute("subid", id); xml.optAttribute("subid", id);
xml.closeEmptyElement(); xml.closeEmptyElement();
xml.closeElement(this);
} }
} }