From 2c2498b65846397ce708452ff45f81ecc25b502f Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Tue, 27 Nov 2012 19:53:04 -0500 Subject: Allow for more credential values to be user specified instead of auto-filled. --- sleekxmpp/features/feature_mechanisms/mechanisms.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'sleekxmpp') diff --git a/sleekxmpp/features/feature_mechanisms/mechanisms.py b/sleekxmpp/features/feature_mechanisms/mechanisms.py index b480d5be..a6e43a76 100644 --- a/sleekxmpp/features/feature_mechanisms/mechanisms.py +++ b/sleekxmpp/features/feature_mechanisms/mechanisms.py @@ -92,11 +92,7 @@ class FeatureMechanisms(BasePlugin): values = required_values.union(optional_values) for value in values: if value == 'username': - result[value] = self.xmpp.requested_jid.user - elif value == 'password': - result[value] = creds['password'] - elif value == 'authzid': - result[value] = creds.get('authzid', '') + result[value] = creds.get('username', self.xmpp.requested_jid.user) elif value == 'email': jid = self.xmpp.requested_jid.bare result[value] = creds.get('email', jid) @@ -106,13 +102,13 @@ class FeatureMechanisms(BasePlugin): else: result[value] = None elif value == 'host': - result[value] = self.xmpp.requested_jid.domain + result[value] = creds.get('host', self.xmpp.requested_jid.domain) elif value == 'realm': - result[value] = self.xmpp.requested_jid.domain + result[value] = creds.get('realm', self.xmpp.requested_jid.domain) elif value == 'service-name': - result[value] = self.xmpp._service_name + result[value] = creds.get('service-name', self.xmpp._service_name) elif value == 'service': - result[value] = 'xmpp' + result[value] = creds.get('service', 'xmpp') elif value in creds: result[value] = creds[value] return result -- cgit v1.2.3