don't allow to delete contacts from an offline account. Fixes #7822
This commit is contained in:
		
							parent
							
								
									a764cb5384
								
							
						
					
					
						commit
						9b3e2e03c9
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		| 
						 | 
					@ -3459,9 +3459,13 @@ class RosterWindow:
 | 
				
			||||||
                    return
 | 
					                    return
 | 
				
			||||||
                jid = model[path][C_JID]
 | 
					                jid = model[path][C_JID]
 | 
				
			||||||
                account = model[path][C_ACCOUNT]
 | 
					                account = model[path][C_ACCOUNT]
 | 
				
			||||||
 | 
					                if not gajim.account_is_connected(account):
 | 
				
			||||||
 | 
					                    continue
 | 
				
			||||||
                contact = gajim.contacts.get_contact_with_highest_priority(
 | 
					                contact = gajim.contacts.get_contact_with_highest_priority(
 | 
				
			||||||
                    account, jid)
 | 
					                    account, jid)
 | 
				
			||||||
                list_.append((contact, account))
 | 
					                list_.append((contact, account))
 | 
				
			||||||
 | 
					            if not list_:
 | 
				
			||||||
 | 
					                return
 | 
				
			||||||
            if type_ == 'contact':
 | 
					            if type_ == 'contact':
 | 
				
			||||||
                self.on_req_usub(widget, list_)
 | 
					                self.on_req_usub(widget, list_)
 | 
				
			||||||
            elif type_ == 'agent':
 | 
					            elif type_ == 'agent':
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue