Ensure that adhoc command clients have form plugin registered.

The form plugin was being registered on first use for providers,
but not for clients receiving the form.

NOTE: Use of non-form payloads will have this issue - adhoc command
      clients will need to have an expectation beforehand of what
      the command payload will be to properly load stanza plugins.
This commit is contained in:
Lance Stout 2011-12-04 01:24:35 -08:00
parent 68cf66a5fe
commit b7b53362e1

View file

@ -17,6 +17,7 @@ from sleekxmpp.xmlstream import register_stanza_plugin, JID
from sleekxmpp.plugins.base import base_plugin
from sleekxmpp.plugins.xep_0050 import stanza
from sleekxmpp.plugins.xep_0050 import Command
from sleekxmpp.plugins.xep_0004 import Form
log = logging.getLogger(__name__)
@ -92,7 +93,8 @@ class xep_0050(base_plugin):
StanzaPath('iq@type=set/command'),
self._handle_command))
register_stanza_plugin(Iq, stanza.Command)
register_stanza_plugin(Iq, Command)
register_stanza_plugin(Command, Form)
self.xmpp.add_event_handler('command_execute',
self._handle_command_start,