diff src/stdui/ui_profile_manager.py @ 1089:8e0072754413

core, plugins, stdui, frontends: fixes handling of "Force server" and "Force port" parameters: - do not save a "guessed" value, they must stay empty until the user explicitely sets them - add constant XMPP_C2S_PORT (default value 5222)
author souliane <souliane@mailoo.org>
date Mon, 23 Jun 2014 10:23:13 +0200
parents b29452cab50b
children 90f82f4ee405
line wrap: on
line diff
--- a/src/stdui/ui_profile_manager.py	Mon Jun 23 00:44:10 2014 +0200
+++ b/src/stdui/ui_profile_manager.py	Mon Jun 23 10:23:13 2014 +0200
@@ -24,6 +24,7 @@
 from sat.memory.crypto import PasswordHasher
 from sat.memory.memory import ProfileSessions
 from twisted.internet import defer
+from twisted.words.protocols.jabber import jid
 
 
 class ProfileManager(object):
@@ -111,6 +112,8 @@
         session_data = self._sessions.profileGetUnique(profile)
         if not session_data:
             server = self.host.memory.getParamA(C.FORCE_SERVER_PARAM, "Connection", profile_key=profile)
+            if not server:
+                server = jid.parse(self.host.memory.getParamA('JabberID', "Connection", profile_key=profile))[1]
             session_id, session_data = self._sessions.newSession({'count': 0, 'server': server}, profile)
         if session_data['count'] > 2:  # 3 attempts with a new password after the initial try
             self._sessions.profileDelUnique(profile)