comparison src/stdui/ui_profile_manager.py @ 1212:628e320eab1f

memory: Sessions.newSession can be called with a forced session ID
author souliane <souliane@mailoo.org>
date Sun, 21 Sep 2014 13:10:55 +0200
parents 90f82f4ee405
children cfd636203e8f
comparison
equal deleted inserted replaced
1211:9355f48f979e 1212:628e320eab1f
112 session_data = self._sessions.profileGetUnique(profile) 112 session_data = self._sessions.profileGetUnique(profile)
113 if not session_data: 113 if not session_data:
114 server = self.host.memory.getParamA(C.FORCE_SERVER_PARAM, "Connection", profile_key=profile) 114 server = self.host.memory.getParamA(C.FORCE_SERVER_PARAM, "Connection", profile_key=profile)
115 if not server: 115 if not server:
116 server = jid.parse(self.host.memory.getParamA('JabberID', "Connection", profile_key=profile))[1] 116 server = jid.parse(self.host.memory.getParamA('JabberID', "Connection", profile_key=profile))[1]
117 session_id, session_data = self._sessions.newSession({'count': 0, 'server': server}, profile) 117 session_id, session_data = self._sessions.newSession({'count': 0, 'server': server}, profile=profile)
118 if session_data['count'] > 2: # 3 attempts with a new password after the initial try 118 if session_data['count'] > 2: # 3 attempts with a new password after the initial try
119 self._sessions.profileDelUnique(profile) 119 self._sessions.profileDelUnique(profile)
120 _dialog = xml_tools.XMLUI('popup', title=D_('Connection error')) 120 _dialog = xml_tools.XMLUI('popup', title=D_('Connection error'))
121 _dialog.addText(D_("Can't connect to %s. Please check your connection details.") % session_data['server']) 121 _dialog.addText(D_("Can't connect to %s. Please check your connection details.") % session_data['server'])
122 return {'xmlui': _dialog.toXml()} 122 return {'xmlui': _dialog.toXml()}