diff options
author | Lance Stout <lancestout@gmail.com> | 2011-02-14 13:50:59 -0500 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2011-02-14 13:50:59 -0500 |
commit | d709f8db657aa1d1314082d842dd29e2546739c4 (patch) | |
tree | bb3ef6894e5bdc8de24e640183b271fefbcb1fee | |
parent | 75584d7ad74b284d30164cde0b5efec2c845d207 (diff) | |
download | slixmpp-d709f8db657aa1d1314082d842dd29e2546739c4.tar.gz slixmpp-d709f8db657aa1d1314082d842dd29e2546739c4.tar.bz2 slixmpp-d709f8db657aa1d1314082d842dd29e2546739c4.tar.xz slixmpp-d709f8db657aa1d1314082d842dd29e2546739c4.zip |
Use the _build_stanza method.
-rw-r--r-- | sleekxmpp/xmlstream/xmlstream.py | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/sleekxmpp/xmlstream/xmlstream.py b/sleekxmpp/xmlstream/xmlstream.py index 87771adf..a5151d7b 100644 --- a/sleekxmpp/xmlstream/xmlstream.py +++ b/sleekxmpp/xmlstream/xmlstream.py @@ -813,13 +813,7 @@ class XMLStream(object): # Convert the raw XML object into a stanza object. If no registered # stanza type applies, a generic StanzaBase stanza will be used. - stanza_type = StanzaBase - for stanza_class in self.__root_stanza: - if xml.tag == "{%s}%s" % (self.default_ns, stanza_class.name) or \ - xml.tag == stanza_class.tag_name(): - stanza_type = stanza_class - break - stanza = stanza_type(self, xml) + stanza = self._build_stanza(xml) # Match the stanza against registered handlers. Handlers marked # to run "in stream" will be executed immediately; the rest will @@ -827,7 +821,7 @@ class XMLStream(object): unhandled = True for handler in self.__handlers: if handler.match(stanza): - stanza_copy = stanza_type(self, copy.deepcopy(xml)) + stanza_copy = copy.copy(stanza) handler.prerun(stanza_copy) self.event_queue.put(('stanza', handler, stanza_copy)) try: |