fritzy / SleekXMPP

Python 2.6+/3.1+ XMPP Library
http://groups.google.com/group/sleekxmpp-discussion
Other
1.1k stars 299 forks source link

xep_0004 doesn’t allow a field of type="hidden" in Form.add_field #246

Open mathieui opened 11 years ago

mathieui commented 11 years ago

Adding a field of type="hidden" is impossible if the form is not of type "form" or "result".

But we need to do so with the forms we return in e.g. XEP-0133.

Of course, we can bypass that with field['type'] = 'hidden' after the form.add_field, but I think it would be better to remove the

else:
    del field['type']

in xep_0004/stanza/form.py

bear commented 9 years ago

@legastero does removing the else as mentioned seem ok?

https://github.com/fritzy/SleekXMPP/blob/develop/sleekxmpp/plugins/xep_0004/stanza/form.py#L78