robbiehanson/XMPPFramework — pull request #248 by mmacvicar (2013-09-11 14:11:25+00:00)
Title: Fix some XEP-0060 pub sub messages are malformed.

The formForOptions method in Extensions/XEP-0060/XMPPPubSub.m is creating a proper form options but always wrapping it with an options element. It is quite clear from the calls to this method that the expected result is the element.

There are 5 uses which require the x element to be a child of different elements:
- Node subscription options, should be child of
- Subscription configuration, should be child of as well.
- Node creation options, should be child of , this was malformed. This line shows that the intention was to put x under configure but the formForOptions method was returning the wrong thing:
NSXMLElement *x = [self formForOptions:options withFromType:XMLNS_PUBSUB_NODE_CONFIG];
- Node configuration options, same as the previous one.
- Publish node options, in this case the element should be under . Again the intention was ok but the formForOptions returned the wrong thing.
NSXMLElement *x = [self formForOptions:options withFromType:XMLNS_PUBSUB_PUBLISH_OPTIONS];