From 04b6d6a8f02f0ab71c6b9c45da3a36608e8e55bf Mon Sep 17 00:00:00 2001
From: Yann Leboulanger <asterix@lagaule.org>
Date: Sun, 26 Nov 2006 12:56:44 +0000
Subject: [PATCH] reduce number of if / elif

---
 src/common/gajim.py | 18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)

diff --git a/src/common/gajim.py b/src/common/gajim.py
index 9f03b09d49..91e6eab8ec 100644
--- a/src/common/gajim.py
+++ b/src/common/gajim.py
@@ -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
 
-- 
GitLab