summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins/xep_0050/adhoc.py
diff options
context:
space:
mode:
authorRobert Robinson <rerobins@gmail.com>2015-09-18 13:35:28 -0600
committerRobert Robinson <rerobins@gmail.com>2015-09-18 13:35:28 -0600
commitc2dc44cfd17d24f7737113efb4e0e9cab5d7d09f (patch)
treed7a08ff192eac6e341e66891a0ded70ebd0e238f /sleekxmpp/plugins/xep_0050/adhoc.py
parent5fc14de32e7fbd4e33a0e1ed92d8fb23871a2a2d (diff)
parentffb2b6bc0464a9646d4b4bca3943d3a89dfc13a6 (diff)
downloadslixmpp-c2dc44cfd17d24f7737113efb4e0e9cab5d7d09f.tar.gz
slixmpp-c2dc44cfd17d24f7737113efb4e0e9cab5d7d09f.tar.bz2
slixmpp-c2dc44cfd17d24f7737113efb4e0e9cab5d7d09f.tar.xz
slixmpp-c2dc44cfd17d24f7737113efb4e0e9cab5d7d09f.zip
Merge branch 'develop' into xep_0050_updates
# Conflicts: # tests/test_stream_xep_0050.py
Diffstat (limited to 'sleekxmpp/plugins/xep_0050/adhoc.py')
-rw-r--r--sleekxmpp/plugins/xep_0050/adhoc.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/sleekxmpp/plugins/xep_0050/adhoc.py b/sleekxmpp/plugins/xep_0050/adhoc.py
index e5594c3f..7ab659f4 100644
--- a/sleekxmpp/plugins/xep_0050/adhoc.py
+++ b/sleekxmpp/plugins/xep_0050/adhoc.py
@@ -101,7 +101,7 @@ class XEP_0050(BasePlugin):
self._handle_command))
register_stanza_plugin(Iq, Command)
- register_stanza_plugin(Command, Form)
+ register_stanza_plugin(Command, Form, iterable=True)
self.xmpp.add_event_handler('command_execute',
self._handle_command_start,
@@ -425,12 +425,25 @@ class XEP_0050(BasePlugin):
del self.sessions[sessionid]
+ payload = session['payload']
+ if payload is None:
+ payload = []
+ if not isinstance(payload, list):
+ payload = [payload]
+
+ for item in payload:
+ register_stanza_plugin(Command, item.__class__, iterable=True)
+
iq.reply()
iq['command']['node'] = node
iq['command']['sessionid'] = sessionid
iq['command']['actions'] = []
iq['command']['status'] = 'completed'
iq['command']['notes'] = session['notes']
+
+ for item in payload:
+ iq['command'].append(item)
+
iq.send()
else:
raise XMPPError('item-not-found')