summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sleekxmpp/features/feature_mechanisms/mechanisms.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/sleekxmpp/features/feature_mechanisms/mechanisms.py b/sleekxmpp/features/feature_mechanisms/mechanisms.py
index 570b7141..3818c70e 100644
--- a/sleekxmpp/features/feature_mechanisms/mechanisms.py
+++ b/sleekxmpp/features/feature_mechanisms/mechanisms.py
@@ -105,14 +105,17 @@ class FeatureMechanisms(BasePlugin):
# server has incorrectly offered it again.
return False
- self.mech_list = set(features['mechanisms'])
+ if not self.use_mech:
+ self.mech_list = set(features['mechanisms'])
+ else:
+ self.mech_list = set([self.use_mech])
return self._send_auth()
def _send_auth(self):
mech_list = self.mech_list - self.attempted_mechs
self.mech = self.sasl.choose_mechanism(mech_list)
- if self.mech is not None:
+ if mech_list and self.mech is not None:
resp = stanza.Auth(self.xmpp)
resp['mechanism'] = self.mech.name
try: