Provide method to get the account name from a jid
This commit is contained in:
		
							parent
							
								
									2bb5d55c03
								
							
						
					
					
						commit
						093ba8dd97
					
				
					 1 changed files with 5 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -483,6 +483,11 @@ def get_jid_from_account(account_name):
 | 
			
		|||
    jid = name + '@' + hostname
 | 
			
		||||
    return jid
 | 
			
		||||
 | 
			
		||||
def get_account_from_jid(jid):
 | 
			
		||||
    for account in app.config.get_per('accounts'):
 | 
			
		||||
        if jid == get_jid_from_account(account):
 | 
			
		||||
            return jid
 | 
			
		||||
 | 
			
		||||
def get_our_jids():
 | 
			
		||||
    """
 | 
			
		||||
    Returns a list of the jids we use in our accounts
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue