Skip to content
This repository has been archived by the owner on Feb 19, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
legastero committed Aug 17, 2012
2 parents a249f87 + 8a03bd7 commit ff28b0a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
7 changes: 6 additions & 1 deletion sleekxmpp/basexmpp.py
Expand Up @@ -68,7 +68,12 @@ def __init__(self, jid='', default_ns='jabber:client'):
#: An identifier for the stream as given by the server. #: An identifier for the stream as given by the server.
self.stream_id = None self.stream_id = None


#: The JabberID (JID) used by this connection. #: The JabberID (JID) requested for this connection.
self.requested_jid = JID(jid)

#: The JabberID (JID) used by this connection,
#: as set after session binding. This may even be a
#: different bare JID than what was requested.
self.boundjid = JID(jid) self.boundjid = JID(jid)


self._expected_server_name = self.boundjid.host self._expected_server_name = self.boundjid.host
Expand Down
8 changes: 4 additions & 4 deletions sleekxmpp/features/feature_mechanisms/mechanisms.py
Expand Up @@ -92,23 +92,23 @@ def _default_credentials(self, required_values, optional_values):
values = required_values.union(optional_values) values = required_values.union(optional_values)
for value in values: for value in values:
if value == 'username': if value == 'username':
result[value] = self.xmpp.boundjid.user result[value] = self.xmpp.requested_jid.user
elif value == 'password': elif value == 'password':
result[value] = creds['password'] result[value] = creds['password']
elif value == 'authzid': elif value == 'authzid':
result[value] = creds.get('authzid', '') result[value] = creds.get('authzid', '')
elif value == 'email': elif value == 'email':
jid = self.xmpp.boundjid.bare jid = self.xmpp.requested_jid.bare
result[value] = creds.get('email', jid) result[value] = creds.get('email', jid)
elif value == 'channel_binding': elif value == 'channel_binding':
if sys.version_info >= (3, 3): if sys.version_info >= (3, 3):
result[value] = self.xmpp.socket.get_channel_binding() result[value] = self.xmpp.socket.get_channel_binding()
else: else:
result[value] = None result[value] = None
elif value == 'host': elif value == 'host':
result[value] = self.xmpp.boundjid.domain result[value] = self.xmpp.requested_jid.domain
elif value == 'realm': elif value == 'realm':
result[value] = self.xmpp.boundjid.domain result[value] = self.xmpp.requested_jid.domain
elif value == 'service-name': elif value == 'service-name':
result[value] = self.xmpp._service_name result[value] = self.xmpp._service_name
elif value == 'service': elif value == 'service':
Expand Down

0 comments on commit ff28b0a

Please sign in to comment.