diff options
author | Nathan Fritz <fritzy@netflint.net> | 2009-12-10 01:23:03 +0000 |
---|---|---|
committer | Nathan Fritz <fritzy@netflint.net> | 2009-12-10 01:23:03 +0000 |
commit | 007b04dd3086a0b02865c924022db70bbd47445e (patch) | |
tree | 664e27d3bea780e88ebc4cc6ac3c4014a654c056 /sleekxmpp/xmlstream/xmlstream.py | |
parent | 6be17ebbe27c17da01abe4fe1134e070c6ee632f (diff) | |
download | slixmpp-007b04dd3086a0b02865c924022db70bbd47445e.tar.gz slixmpp-007b04dd3086a0b02865c924022db70bbd47445e.tar.bz2 slixmpp-007b04dd3086a0b02865c924022db70bbd47445e.tar.xz slixmpp-007b04dd3086a0b02865c924022db70bbd47445e.zip |
* added proper message and iq stanzas. presence left to do
Diffstat (limited to 'sleekxmpp/xmlstream/xmlstream.py')
-rw-r--r-- | sleekxmpp/xmlstream/xmlstream.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/sleekxmpp/xmlstream/xmlstream.py b/sleekxmpp/xmlstream/xmlstream.py index 8ffb7841..8971a02c 100644 --- a/sleekxmpp/xmlstream/xmlstream.py +++ b/sleekxmpp/xmlstream/xmlstream.py @@ -44,7 +44,7 @@ class XMLStream(object): self.__thread = {} - self.__root_stanza = {} + self.__root_stanza = [] self.__stanza = {} self.__stanza_extension = {} self.__handlers = [] @@ -251,11 +251,13 @@ class XMLStream(object): xmlobj = self.incoming_filter(xmlobj) stanza = None for stanza_class in self.__root_stanza: - if self.__root_stanza[stanza_class].match(xmlobj): + if xmlobj.tag == "{%s}%s" % (self.default_ns, stanza_class.name): + #if self.__root_stanza[stanza_class].match(xmlobj): stanza = stanza_class(self, xmlobj) break if stanza is None: stanza = StanzaBase(self, xmlobj) + logging.debug(self.__handlers) for handler in self.__handlers: if handler.match(xmlobj): handler.prerun(stanza) @@ -293,12 +295,9 @@ class XMLStream(object): return idx += 1 - def registerStanza(self, matcher, stanza_class, root=True): + def registerStanza(self, stanza_class): "Adds stanza. If root stanzas build stanzas sent in events while non-root stanzas build substanza objects." - if root: - self.__root_stanza[stanza_class] = matcher - else: - self.__stanza[stanza_class] = matcher + self.__root_stanza.append(stanza_class) def registerStanzaExtension(self, stanza_class, stanza_extension): if stanza_class not in stanza_extensions: |