diff options
author | Lance Stout <lancestout@gmail.com> | 2010-07-19 19:19:33 -0400 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2010-07-19 19:19:33 -0400 |
commit | b5a14a0190f6ea45bfbc0e18a7ff6c61b6415865 (patch) | |
tree | 71eefc54a8c1d9586b1e4fb61ebb4b9d46bc2015 /sleekxmpp/__init__.py | |
parent | fec8578cf61696d8ca85a6fe85a55be71d7109fd (diff) | |
download | slixmpp-b5a14a0190f6ea45bfbc0e18a7ff6c61b6415865.tar.gz slixmpp-b5a14a0190f6ea45bfbc0e18a7ff6c61b6415865.tar.bz2 slixmpp-b5a14a0190f6ea45bfbc0e18a7ff6c61b6415865.tar.xz slixmpp-b5a14a0190f6ea45bfbc0e18a7ff6c61b6415865.zip |
Can now pass a name to add_handler so that the handler can be reliably removed later.
Updated uses of add_handler to include a name.
Diffstat (limited to 'sleekxmpp/__init__.py')
-rw-r--r-- | sleekxmpp/__init__.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sleekxmpp/__init__.py b/sleekxmpp/__init__.py index 3d659a85..86b74fc2 100644 --- a/sleekxmpp/__init__.py +++ b/sleekxmpp/__init__.py @@ -175,7 +175,7 @@ class ClientXMPP(basexmpp, XMLStream): def handler_starttls(self, xml): if not self.authenticated and self.ssl_support: - self.add_handler("<proceed xmlns='urn:ietf:params:xml:ns:xmpp-tls' />", self.handler_tls_start, instream=True) + self.add_handler("<proceed xmlns='urn:ietf:params:xml:ns:xmpp-tls' />", self.handler_tls_start, name='TLS Proceed', instream=True) self.sendXML(xml) return True else: @@ -191,8 +191,8 @@ class ClientXMPP(basexmpp, XMLStream): if '{urn:ietf:params:xml:ns:xmpp-tls}starttls' in self.features: return False logging.debug("Starting SASL Auth") - self.add_handler("<success xmlns='urn:ietf:params:xml:ns:xmpp-sasl' />", self.handler_auth_success, instream=True) - self.add_handler("<failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl' />", self.handler_auth_fail, instream=True) + self.add_handler("<success xmlns='urn:ietf:params:xml:ns:xmpp-sasl' />", self.handler_auth_success, name='SASL Sucess', instream=True) + self.add_handler("<failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl' />", self.handler_auth_fail, name='SASL Failure', instream=True) sasl_mechs = xml.findall('{urn:ietf:params:xml:ns:xmpp-sasl}mechanism') if len(sasl_mechs): for sasl_mech in sasl_mechs: |