1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-25 15:52:06 +01:00

Fix EnablePushNotificationsIQ wrong form type

Should be submit instead of form
Fixes SMACK-752
This commit is contained in:
andri.khrisharyadi 2017-04-03 18:59:14 +07:00
parent 8a8c01a4e5
commit c8b4df4f84
2 changed files with 2 additions and 2 deletions

View file

@ -96,7 +96,7 @@ public class EnablePushNotificationsIQ extends IQ {
xml.rightAngleBracket(); xml.rightAngleBracket();
if (publishOptions != null) { if (publishOptions != null) {
DataForm dataForm = new DataForm(DataForm.Type.form); DataForm dataForm = new DataForm(DataForm.Type.submit);
FormField formTypeField = new FormField("FORM_TYPE"); FormField formTypeField = new FormField("FORM_TYPE");
formTypeField.addValue(PubSub.NAMESPACE + "#publish-options"); formTypeField.addValue(PubSub.NAMESPACE + "#publish-options");

View file

@ -31,7 +31,7 @@ public class EnablePushNotificationsIQTest {
String exampleEnableIQWithPublishOptions = "<iq id='x42' type='set'>" String exampleEnableIQWithPublishOptions = "<iq id='x42' type='set'>"
+ "<enable xmlns='urn:xmpp:push:0' jid='push-5.client.example' node='yxs32uqsflafdk3iuqo'>" + "<enable xmlns='urn:xmpp:push:0' jid='push-5.client.example' node='yxs32uqsflafdk3iuqo'>"
+ "<x xmlns='jabber:x:data' type='form'>" + "<x xmlns='jabber:x:data' type='submit'>"
+ "<field var='FORM_TYPE'><value>http://jabber.org/protocol/pubsub#publish-options</value></field>" + "<field var='FORM_TYPE'><value>http://jabber.org/protocol/pubsub#publish-options</value></field>"
+ "<field var='secret'><value>eruio234vzxc2kla-91</value></field>" + "</x>" + "</enable>" + "</iq>"; + "<field var='secret'><value>eruio234vzxc2kla-91</value></field>" + "</x>" + "</enable>" + "</iq>";