diff --git a/src/common/connection.py b/src/common/connection.py index 6ff1c9d7c..a163cddd4 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -724,14 +724,18 @@ class Connection: signed = '' keyID = gajim.config.get_per('accounts', self.name, 'keyid') if keyID and USE_GPG: - if not msg: - lowered_uf_status_msg = helpers.get_uf_show(show).lower() - msg = _("I'm %s") % lowered_uf_status_msg - signed = self.gpg.sign(msg, keyID) - if signed == 'BAD_PASSPHRASE': - signed = '' - if self.connected < 2: - self.dispatch('BAD_PASSPHRASE', ()) + if self.connected < 2 and self.gpg.passphrase == None: # We didn't set a passphrase + self.dispatch('ERROR', (_('OpenPGP Key was not given'), + _('You will be connected to %s without OpenPGP.') % self.name)) + else: + if not msg: + lowered_uf_status_msg = helpers.get_uf_show(show).lower() + msg = _("I'm %s") % lowered_uf_status_msg + signed = self.gpg.sign(msg, keyID) + if signed == 'BAD_PASSPHRASE': + signed = '' + if self.connected < 2: + self.dispatch('BAD_PASSPHRASE', ()) self.status = msg if show != 'offline' and not self.connected: self.connection = self.connect() diff --git a/src/roster_window.py b/src/roster_window.py index c62bf475b..a77637e10 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -907,7 +907,7 @@ _('If "%s" accepts this request you will know his status.') %jid).get_response() _('Save passphrase')) passphrase, save = w.run() if passphrase == -1: - passphrase = '' + passphrase = None else: self.gpg_passphrase[keyid] = passphrase gobject.timeout_add(30000, self.forget_gpg_passphrase, keyid)