don't add twice the same account. Fixes #1752

This commit is contained in:
Yann Leboulanger 2006-03-26 23:55:59 +00:00
parent bdda6d1555
commit c0534e9515
1 changed files with 13 additions and 1 deletions

View File

@ -2540,6 +2540,18 @@ class AccountCreationWizardWindow:
dialogs.ErrorDialog(pritext, str(s)).get_response()
return
already_in_jids = []
for account in gajim.connections:
j = gajim.config.get_per('accounts', account, 'name')
j += '@' + gajim.config.get_per('accounts', account, 'hostname')
already_in_jids.append(j)
if jid in already_in_jids:
pritext = _('Duplicate Jabber ID')
sectext = _('This account is already configured in Gajim.')
dialogs.ErrorDialog(pritext, sectext).get_response()
return
self.account = server
i = 1
while self.account in gajim.connections: