reduce number of if / elif

This commit is contained in:
Yann Leboulanger 2006-11-26 12:56:44 +00:00
parent a57b3ad160
commit 04b6d6a8f0
1 changed files with 2 additions and 16 deletions

View File

@ -265,26 +265,12 @@ def get_transport_name_from_jid(jid, use_config_setting = True):
# now we support both 'icq.' and 'icq' but not icqsucks.org
host = host_splitted[0]
if host == 'aim':
return 'aim'
if host in ('aim', 'irc', 'icq', 'msn', 'sms', 'tlen', 'weather', 'yahoo'):
return host
elif host == 'gg':
return 'gadu-gadu'
elif host == 'irc':
return 'irc'
elif host == 'icq':
return 'icq'
elif host == 'jit':
return 'icq'
elif host == 'msn':
return 'msn'
elif host == 'sms':
return 'sms'
elif host == 'tlen':
return 'tlen'
elif host == 'weather':
return 'weather'
elif host == 'yahoo':
return 'yahoo'
else:
return None