diff options
author | Yann Leboulanger <asterix@lagaule.org> | 2008-08-01 14:22:24 +0400 |
---|---|---|
committer | Yann Leboulanger <asterix@lagaule.org> | 2008-08-01 14:22:24 +0400 |
commit | 91300042495a545324757e8744355a8778162d59 (patch) | |
tree | 3bd4ee610c3363e0126ddf7be5319608ab058686 /src | |
parent | 23d941368766620e15479d4a6abdce6f0ca02448 (diff) |
[avm] prevent eating up the passphrase when you fail to enter it 2 times, but succeed on the 3rd. see #4164
Diffstat (limited to 'src')
-rwxr-xr-x | src/gajim.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/gajim.py b/src/gajim.py index 1c7d7cbbc..103eb2b5a 100755 --- a/src/gajim.py +++ b/src/gajim.py @@ -69,7 +69,7 @@ def parseLogLevel(arg): return int(arg) if arg.isupper(): return getattr(logging, arg) - raise ValueError(_("%s is not a valid loglevel"), repr(arg)) + raise ValueError(_('%s is not a valid loglevel'), repr(arg)) def parseLogTarget(arg): arg = arg.lower() @@ -471,21 +471,21 @@ class PassphraseRequest: self.complete(None) def _ok(passphrase, checked, count): - if count < 3: - done = gajim.connections[account].test_gpg_passphrase(passphrase) - else: - done = True - passphrase = None - - if done: + if gajim.connections[account].test_gpg_passphrase(passphrase): + # passphrase is good self.complete(passphrase) - else: + return + + if count < 3: # ask again dialogs.PassphraseDialog(_('Wrong Passphrase'), _('Please retype your GPG passphrase or press Cancel.'), ok_handler=(_ok, count + 1), cancel_handler=_cancel) + else: + # user failed 3 times, continue without GPG + self.complete(None) - dialogs.PassphraseDialog(title, second, ok_handler=(_ok, 0), + dialogs.PassphraseDialog(title, second, ok_handler=(_ok, 1), cancel_handler=_cancel) self.dialog_created = True @@ -1378,7 +1378,7 @@ class Interface: if '103' in statusCode: changes.append(_('room now does not show unavailable members')) if '104' in statusCode: - changes.append(\ + changes.append( _('A non-privacy-related room configuration change has occurred')) if '170' in statusCode: # Can be a presence (see chg_contact_status in groupchat_control.py) |