plugin XEP-0050: filter form received from form-processing entity, to only keep "form" and "result" types
This commit is contained in:
parent
8f70b2528f
commit
da147c5cc7
1 changed files with 5 additions and 3 deletions
|
|
@ -299,9 +299,11 @@ class XEP_0050(object):
|
|||
for note_elt in command_elt.elements(NS_COMMANDS, 'note'):
|
||||
notes.append((self._getDataLvl(note_elt.getAttribute('type', 'info')),
|
||||
unicode(note_elt)))
|
||||
try:
|
||||
data_elt = command_elt.elements(data_form.NS_X_DATA, 'x').next()
|
||||
except StopIteration:
|
||||
for data_elt in command_elt.elements(data_form.NS_X_DATA, 'x'):
|
||||
if data_elt['type'] in ('form', 'result'):
|
||||
break
|
||||
else:
|
||||
# no matching data element found
|
||||
if status != XEP_0050.STATUS.COMPLETED:
|
||||
log.warning(_("No known payload found in ad-hoc command result, aborting"))
|
||||
del self.requesting[session_id]
|
||||
|
|
|
|||
Loading…
Reference in a new issue