apply patch from dkirov to prevent TB when we create a new account

This commit is contained in:
Yann Leboulanger 2005-07-18 21:16:31 +00:00
parent a47cca07f0
commit 3354201313
2 changed files with 5 additions and 2 deletions

View File

@ -639,8 +639,8 @@ class Connection:
gajim.config.set('usegpg', True)
else:
gajim.config.set('usegpg', False)
self.dispatch('ACC_OK', (self.name, self.new_account_info))
gajim.connections[self.name] = self
self.dispatch('ACC_OK', (self.name, self.new_account_info))
self.new_account_info = None
return
self.dispatch('REGISTER_AGENT_INFO', (data[0], data[1].asDict()))

View File

@ -1286,7 +1286,10 @@ _('To change the account name, you must be disconnected.')).get_response()
_('You must create your account before editing your personal information.')).get_response()
return
jid = self.xml.get_widget('jid_entry').get_text()
if gajim.connections[self.account].connected < 2:
# raise the error if account is newly created (not in gajim.connections)
if not gajim.connections.has_key(self.account) or \
gajim.connections[self.account].connected < 2:
dialogs.ErrorDialog(_('You are not connected to the server'),
_('Without a connection, you can not edit your personal information.')).get_response()
return