[empathy] Special-case XMPP with importing accounts from Pidgin. (Fixes bug #579992)



commit 9c1dfe2afbeae0a3e598e5afe094f42b321e5257
Author: Jonny Lamb <jonny lamb collabora co uk>
Date:   Fri Jun 5 14:59:15 2009 +0100

    Special-case XMPP with importing accounts from Pidgin. (Fixes bug #579992)
    
    It was decided that if pidgin has an account with no host set, then
    both the server and port should be ignored, as a special case in XMPP.
    
    Signed-off-by: Jonny Lamb <jonny lamb collabora co uk>
---
 src/empathy-import-pidgin.c |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/src/empathy-import-pidgin.c b/src/empathy-import-pidgin.c
index a58111d..fad9d83 100644
--- a/src/empathy-import-pidgin.c
+++ b/src/empathy-import-pidgin.c
@@ -288,7 +288,24 @@ empathy_import_pidgin_load (void)
       /* If we have the needed settings, add the account data to the list,
        * otherwise free the data */
       if (data->profile != NULL && g_hash_table_size (data->settings) > 0)
-        accounts = g_list_prepend (accounts, data);
+        {
+          /* Special-case XMPP:
+           * http://bugzilla.gnome.org/show_bug.cgi?id=579992 */
+          if (!tp_strdiff (
+                  mc_profile_get_protocol_name (data->profile), "jabber"))
+            {
+              GValue *server;
+              server = g_hash_table_lookup (data->settings, "server");
+
+              if (!server || EMP_STR_EMPTY (g_value_get_string (server)))
+                {
+                  g_hash_table_remove (data->settings, "port");
+                  g_hash_table_remove (data->settings, "server");
+                }
+            }
+
+          accounts = g_list_prepend (accounts, data);
+        }
       else
         empathy_import_account_data_free (data);
     }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]