remove the contact_mutual_removal advanced option and add a checkbutton in remove_contact dialog to ask if we want to remove both subscriptions
This commit is contained in:
		
							parent
							
								
									41fd150b93
								
							
						
					
					
						commit
						42ffc5d810
					
				
					 3 changed files with 9 additions and 6 deletions
				
			
		|  | @ -38,7 +38,6 @@ class Config: | |||
| 	__options = { | ||||
| 		# name: [ type, value ] | ||||
| 		'verbose': [ opt_bool, False ], | ||||
| 		'contact_mutual_removal': [ opt_bool, True, _('When we remove a contact, remove both his and our subscription, so we do not receive his presence anymore and he ours.')], | ||||
| 		'alwaysauth': [ opt_bool, False ], | ||||
| 		'autopopup': [ opt_bool, False ], | ||||
| 		'notify_on_signin': [ opt_bool, True ], | ||||
|  |  | |||
|  | @ -1710,10 +1710,10 @@ class Connection: | |||
| 		p = self.add_sha(p) | ||||
| 		self.to_be_sent.append(p) | ||||
| 
 | ||||
| 	def unsubscribe(self, jid): | ||||
| 	def unsubscribe(self, jid, remove_auth = True): | ||||
| 		if not self.connection: | ||||
| 			return | ||||
| 		if gajim.config.get('contact_mutual_removal'): | ||||
| 		if remove_auth: | ||||
| 			self.connection.getRoster().delItem(jid) | ||||
| 		else: | ||||
| 			self.connection.getRoster().Unsubscribe(jid) | ||||
|  |  | |||
|  | @ -1216,11 +1216,15 @@ _('If "%s" accepts this request you will know his status.') %jid) | |||
| 
 | ||||
| 	def on_req_usub(self, widget, user, account): | ||||
| 		'''Remove a user''' | ||||
| 		window = dialogs.ConfirmationDialog(\ | ||||
| 		window = dialogs.ConfirmationDialogCheck(\ | ||||
| 			_('Contact "%s" will be removed from your roster') % (user.name), | ||||
| 			_('By removing this contact you also remove authorization. Contact "%s" will always see you as offline.') % user.name) | ||||
| 			_('By removing this contact you also remove authorization. Contact "%s" will always see you as offline.') % user.name, | ||||
| 			_('Allow my contact to still know my status')) | ||||
| 		if window.get_response() == gtk.RESPONSE_OK: | ||||
| 			gajim.connections[account].unsubscribe(user.jid) | ||||
| 			remove_auth = True | ||||
| 			if window.is_checked(): | ||||
| 				remove_auth = False | ||||
| 			gajim.connections[account].unsubscribe(user.jid, remove_auth) | ||||
| 			for u in gajim.contacts[account][user.jid]: | ||||
| 				self.remove_contact(u, account) | ||||
| 			del gajim.contacts[account][u.jid] | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue