diff options
-rw-r--r-- | slixmpp/plugins/xep_0004/stanza/form.py | 6 | ||||
-rw-r--r-- | tests/test_stanza_xep_0060.py | 2 | ||||
-rw-r--r-- | tests/test_stream_xep_0060.py | 10 |
3 files changed, 10 insertions, 8 deletions
diff --git a/slixmpp/plugins/xep_0004/stanza/form.py b/slixmpp/plugins/xep_0004/stanza/form.py index 84c89173..c04193f0 100644 --- a/slixmpp/plugins/xep_0004/stanza/form.py +++ b/slixmpp/plugins/xep_0004/stanza/form.py @@ -48,7 +48,8 @@ class Form(ElementBase): fields = self.get_fields() for var in fields: field = fields[var] - del field['type'] + if field['type'] != 'hidden': + del field['type'] del field['label'] del field['desc'] del field['required'] @@ -74,7 +75,8 @@ class Form(ElementBase): for option in options: field.add_option(**option) else: - del field['type'] + if field['type'] != 'hidden': + del field['type'] self.append(field) return field diff --git a/tests/test_stanza_xep_0060.py b/tests/test_stanza_xep_0060.py index d05bc3d0..671f9cd0 100644 --- a/tests/test_stanza_xep_0060.py +++ b/tests/test_stanza_xep_0060.py @@ -314,7 +314,7 @@ class TestPubsubStanzas(SlixTest): <create node="testnode2" /> <configure> <x xmlns="jabber:x:data" type="submit"> - <field var="FORM_TYPE"> + <field var="FORM_TYPE" type="hidden"> <value>http://jabber.org/protocol/pubsub#node_config</value> </field> <field var="pubsub#node_type"> diff --git a/tests/test_stream_xep_0060.py b/tests/test_stream_xep_0060.py index da543f96..a5fd0bdc 100644 --- a/tests/test_stream_xep_0060.py +++ b/tests/test_stream_xep_0060.py @@ -72,7 +72,7 @@ class TestStreamPubsub(SlixTest): <field var="pubsub#access_model"> <value>whitelist</value> </field> - <field var="FORM_TYPE"> + <field var="FORM_TYPE" type="hidden"> <value>http://jabber.org/protocol/pubsub#node_config</value> </field> </x> @@ -210,7 +210,7 @@ class TestStreamPubsub(SlixTest): <subscribe node="somenode" jid="tester@localhost" /> <options> <x xmlns="jabber:x:data" type="submit"> - <field var="FORM_TYPE"> + <field var="FORM_TYPE" type="hidden"> <value>http://jabber.org/protocol/pubsub#subscribe_options</value> </field> <field var="pubsub#digest"> @@ -358,7 +358,7 @@ class TestStreamPubsub(SlixTest): <pubsub xmlns="http://jabber.org/protocol/pubsub#owner"> <configure node="somenode"> <x xmlns="jabber:x:data" type="submit"> - <field var="FORM_TYPE"> + <field var="FORM_TYPE" type="hidden"> <value>http://jabber.org/protocol/pubsub#node_config</value> </field> <field var="pubsub#title"> @@ -441,7 +441,7 @@ class TestStreamPubsub(SlixTest): </publish> <publish-options> <x xmlns="jabber:x:data" type="submit"> - <field var="FORM_TYPE"> + <field var="FORM_TYPE" type="hidden"> <value>http://jabber.org/protocol/pubsub#publish-options</value> </field> <field var="pubsub#access_model"> @@ -622,7 +622,7 @@ class TestStreamPubsub(SlixTest): <pubsub xmlns="http://jabber.org/protocol/pubsub"> <options node="somenode" jid="tester@localhost"> <x xmlns="jabber:x:data" type="submit"> - <field var="FORM_TYPE"> + <field var="FORM_TYPE" type="hidden"> <value>http://jabber.org/protocol/pubsub#subscribe_options</value> </field> <field var="pubsub#digest"> |