From 12edc2d3be195c0a9650bcf2bb4bf512299c9b2d Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Thu, 28 Feb 2013 18:14:02 +0200 Subject: [PATCH] purple: improve Adium server hack - only compile it in when ADIUM is defined - remove unnecessary g_strsplit() --- src/purple/purple-plugin.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/purple/purple-plugin.c b/src/purple/purple-plugin.c index 87a9c591..49747d11 100644 --- a/src/purple/purple-plugin.c +++ b/src/purple/purple-plugin.c @@ -369,14 +369,16 @@ static void connect_to_core(PurpleConnection *gc, purple_connection_set_display_name(gc, sipe_public->sip_name); purple_connection_update_progress(gc, _("Connecting"), 1, 2); - username_split = g_strsplit(purple_account_get_string(account, "server", ""), ":", 2); - - /* The adium client requires a server string be supplied. If the user entered adium.im assume - they really want autodiscovery */ - if (username_split[0] && sipe_strequal(username_split[0], "adium.im")) { - g_strfreev(username_split); - username_split = g_strsplit("", ":", 2); - } + errmsg = purple_account_get_string(account, "server", ""); +#ifdef ADIUM + /* + * The Adium client requires a server string be supplied. If the user + * entered "adium.im" assume they really want autodiscovery. + */ + if (sipe_strequal(errmsg, "adium.im")) + errmsg = ""; +#endif + username_split = g_strsplit(errmsg, ":", 2); if (sipe_strequal(transport, "auto")) { transport_type = (username_split[0] == NULL) ? -- 2.11.4.GIT