* fixed unhandled iqs

This commit is contained in:
Nathan Fritz
2009-12-22 10:05:53 +00:00
parent 07018c0afa
commit 805afa4bc1
3 changed files with 12 additions and 13 deletions

View File

@@ -214,8 +214,8 @@ class StanzaBase(ElementBase):
def clear(self):
for child in self.xml.getchildren():
self.xml.remove(child)
for plugin in self.plugins:
del self.plugins[plugin]
#for plugin in list(self.plugins.keys()):
# del self.plugins[plugin]
def reply(self):
self['from'], self['to'] = self['to'], self['from']

View File

@@ -257,14 +257,15 @@ class XMLStream(object):
break
if stanza is None:
stanza = StanzaBase(self, xmlobj)
unhandled = True
for handler in self.__handlers:
if handler.match(xmlobj):
handler.prerun(stanza)
self.eventqueue.put(('stanza', handler, stanza))
if handler.checkDelete(): self.__handlers.pop(self.__handlers.index(handler))
else:
stanza.unhandled()
unhandled = False
if unhandled:
stanza.unhandled()
#loop through handlers and test match
#spawn threads as necessary, call handlers, sending Stanza