Blob Blame History Raw
diff -urp empathy-2.25.90.OLD/src/empathy.c empathy-2.25.90/src/empathy.c
--- empathy-2.25.90.OLD/src/empathy.c	2009-02-03 04:01:43.000000000 -0500
+++ empathy-2.25.90/src/empathy.c	2009-02-11 11:58:15.000000000 -0500
@@ -404,6 +404,47 @@ new_call_handler_cb (EmpathyCallFactory 
 		gtk_widget_show (GTK_WIDGET (window));
 }
 
+/* This change is specific to Fedora and how we set up
+ * the mission control profiles before.  This patch
+ * can probably be removed by Fedora 11-12.
+ */
+static void
+fedora_mission_control_convert ()
+{
+	GDir *accts;
+	const char *name;
+	GError *error = NULL;
+	char *path;
+
+	path = g_build_filename (g_get_home_dir (), ".mission-control", 
+				 "accounts", NULL);
+	accts = g_dir_open (path, 0, &error);
+	/* If no accts dir, that's fine */
+	if (!accts)
+		return;
+	while ((name = g_dir_read_name (accts)) != NULL) {
+		char *fullpath = g_build_filename (path, name, NULL);
+		char *newpath = NULL;
+
+		if (g_str_has_prefix (name, "haze-aim") ||
+		    g_str_has_prefix (name, "haze-icq") ||
+		    g_str_has_prefix (name, "haze-yahoo"))
+			newpath = g_build_filename (path, name + strlen ("haze-"), NULL);
+		else if (g_str_has_prefix (name, "haze-msn"))
+			newpath = g_strdup_printf ("%s/%s%s", path, "msn-haze", 
+						   name + strlen ("haze-msn"));
+		
+		if (newpath) {
+			g_rename (fullpath, newpath);
+			g_free (newpath);
+		}
+ 		g_free (fullpath);
+	}
+
+	g_dir_close (accts);
+	g_free (path);
+}
+
 int
 main (int argc, char *argv[])
 {
@@ -458,6 +499,8 @@ main (int argc, char *argv[])
 	gtk_window_set_default_icon_name ("empathy");
 	textdomain (GETTEXT_PACKAGE);
 
+	fedora_mission_control_convert ();
+
         /* Setting up the bacon connection */
 	startup_timestamp = get_startup_timestamp ();
 	connection = bacon_message_connection_new ("empathy");