summaryrefslogtreecommitdiff
path: root/sleekxmpp/features/sasl_plain.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2011-07-02 21:57:50 -0700
committerLance Stout <lancestout@gmail.com>2011-07-02 21:57:50 -0700
commitfba235a801a3a1c06d1769cdc944b72dce33f88a (patch)
tree905c3243cee4991b0fc81332809f34042a2031c6 /sleekxmpp/features/sasl_plain.py
parentb0297af38d6dcd9ebfdaa0131ea798c9fe2b8c63 (diff)
downloadslixmpp-fba235a801a3a1c06d1769cdc944b72dce33f88a.tar.gz
slixmpp-fba235a801a3a1c06d1769cdc944b72dce33f88a.tar.bz2
slixmpp-fba235a801a3a1c06d1769cdc944b72dce33f88a.tar.xz
slixmpp-fba235a801a3a1c06d1769cdc944b72dce33f88a.zip
Simplify SASL mech registration.
Moved SASL registration completely to the feature plugin, instead of keeping a portion of it in ClientXMPP.
Diffstat (limited to 'sleekxmpp/features/sasl_plain.py')
-rw-r--r--sleekxmpp/features/sasl_plain.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/sleekxmpp/features/sasl_plain.py b/sleekxmpp/features/sasl_plain.py
index 270d28fe..427660ab 100644
--- a/sleekxmpp/features/sasl_plain.py
+++ b/sleekxmpp/features/sasl_plain.py
@@ -14,8 +14,9 @@ class sasl_plain(base_plugin):
self.name = 'SASL PLAIN'
self.rfc = '6120'
self.description = 'SASL PLAIN Mechanism'
+ self.stanza = self.xmpp['feature_mechanisms'].stanza
- self.xmpp.register_sasl_mechanism('PLAIN',
+ self.xmpp['feature_mechanisms'].register('PLAIN',
self._handle_plain,
priority=self.config.get('priority', 1))
@@ -33,7 +34,7 @@ class sasl_plain(base_plugin):
auth = base64.b64encode(b'\x00' + user + \
b'\x00' + password).decode('utf-8')
- resp = self.xmpp['feature_mechanisms'].stanza.Auth(self.xmpp)
+ resp = self.stanza.Auth(self.xmpp)
resp['mechanism'] = 'PLAIN'
resp['value'] = auth
resp.send(now=True)