show notification for bad GPG pass instead of an error dialog
This commit is contained in:
		
							parent
							
								
									7d7ca4d4ae
								
							
						
					
					
						commit
						0ea6544c26
					
				
					 2 changed files with 8 additions and 5 deletions
				
			
		| 
						 | 
					@ -2615,9 +2615,7 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
 | 
				
			||||||
		if sign_msg and not signed:
 | 
							if sign_msg and not signed:
 | 
				
			||||||
			signed = self.get_signed_presence(msg)
 | 
								signed = self.get_signed_presence(msg)
 | 
				
			||||||
			if signed is None:
 | 
								if signed is None:
 | 
				
			||||||
				self.dispatch('ERROR', (_('OpenPGP passphrase was not given'),
 | 
									self.dispatch('BAD_PASSPHRASE', ())
 | 
				
			||||||
					#%s is the account name here
 | 
					 | 
				
			||||||
					_('You will be connected to %s without OpenPGP.') % self.name))
 | 
					 | 
				
			||||||
				self.USE_GPG = False
 | 
									self.USE_GPG = False
 | 
				
			||||||
				signed = ''
 | 
									signed = ''
 | 
				
			||||||
		self.connected = gajim.SHOW_LIST.index(show)
 | 
							self.connected = gajim.SHOW_LIST.index(show)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1509,10 +1509,15 @@ class Interface:
 | 
				
			||||||
		if use_gpg_agent:
 | 
							if use_gpg_agent:
 | 
				
			||||||
			sectext = _('You configured Gajim to use GPG agent, but there is no '
 | 
								sectext = _('You configured Gajim to use GPG agent, but there is no '
 | 
				
			||||||
			'GPG agent running or it returned a wrong passphrase.\n')
 | 
								'GPG agent running or it returned a wrong passphrase.\n')
 | 
				
			||||||
		sectext += _('You are currently connected without your OpenPGP key.')
 | 
								sectext += _('You are currently connected without your OpenPGP key.')
 | 
				
			||||||
 | 
								dialogs.WarningDialog(_('Your passphrase is incorrect'), sectext)
 | 
				
			||||||
 | 
							else:
 | 
				
			||||||
 | 
								path = os.path.join(gajim.DATA_DIR, 'pixmaps', 'warning.png')
 | 
				
			||||||
 | 
								notify.popup('warning', account, account, 'warning', path,
 | 
				
			||||||
 | 
									_('OpenGPG Passphrase Incorrect'),
 | 
				
			||||||
 | 
									_('You are currently connected without your OpenPGP key.'))
 | 
				
			||||||
		keyID = gajim.config.get_per('accounts', account, 'keyid')
 | 
							keyID = gajim.config.get_per('accounts', account, 'keyid')
 | 
				
			||||||
		self.forget_gpg_passphrase(keyID)
 | 
							self.forget_gpg_passphrase(keyID)
 | 
				
			||||||
		dialogs.WarningDialog(_('Your passphrase is incorrect'), sectext)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	def handle_event_gpg_password_required(self, account, array):
 | 
						def handle_event_gpg_password_required(self, account, array):
 | 
				
			||||||
		#('GPG_PASSWORD_REQUIRED', account, (callback,))
 | 
							#('GPG_PASSWORD_REQUIRED', account, (callback,))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue