use helper function. fixes #3263
This commit is contained in:
		
							parent
							
								
									30a9202f9d
								
							
						
					
					
						commit
						fd03586f2c
					
				
					 1 changed files with 3 additions and 6 deletions
				
			
		| 
						 | 
					@ -233,14 +233,11 @@ class Contacts:
 | 
				
			||||||
			return contacts_instances
 | 
								return contacts_instances
 | 
				
			||||||
		return []
 | 
							return []
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	def get_contact_from_full_jid(self, account, jid):
 | 
						def get_contact_from_full_jid(self, account, fjid):
 | 
				
			||||||
		'''we will split the jid into bare jid and resource part,
 | 
							'''we will split the jid into bare jid and resource part,
 | 
				
			||||||
		then get proper contact.'''
 | 
							then get proper contact.'''
 | 
				
			||||||
		try:
 | 
							barejid, resource = common.gajim.get_room_and_nick_from_fjid(fjid)
 | 
				
			||||||
			barejid, resource=jid.split('/',1)
 | 
					 | 
				
			||||||
		return self.get_contact(account, barejid, resource)
 | 
							return self.get_contact(account, barejid, resource)
 | 
				
			||||||
		except ValueError: # no resource causes split to fail
 | 
					 | 
				
			||||||
			return None # how to handle that case?
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	def get_highest_prio_contact_from_contacts(self, contacts):
 | 
						def get_highest_prio_contact_from_contacts(self, contacts):
 | 
				
			||||||
		if not contacts:
 | 
							if not contacts:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue