abdd45
diff -urN pidgin-2.5.2.orig/pidgin/gtksound.c pidgin-2.5.2/pidgin/gtksound.c
abdd45
--- pidgin-2.5.2.orig/pidgin/gtksound.c	2008-07-13 22:05:38.000000000 -0400
abdd45
+++ pidgin-2.5.2/pidgin/gtksound.c	2008-11-22 13:36:54.000000000 -0500
abdd45
@@ -298,6 +298,9 @@
abdd45
 	purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/sound/mute", FALSE);
abdd45
 	purple_prefs_add_path(PIDGIN_PREFS_ROOT "/sound/command", "");
abdd45
 	purple_prefs_add_string(PIDGIN_PREFS_ROOT "/sound/method", "automatic");
abdd45
+#ifndef USE_GSTREAMER
abdd45
+	purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/sound/rhel4migrated", FALSE);
abdd45
+#endif
abdd45
 	purple_prefs_add_int(PIDGIN_PREFS_ROOT "/sound/volume", 50);
abdd45
 
abdd45
 #ifdef USE_GSTREAMER
abdd45
@@ -433,6 +436,19 @@
abdd45
 		return;
abdd45
 	}
abdd45
 
abdd45
+#ifndef USE_GSTREAMER
abdd45
+	/* RHEL4 migration code */
abdd45
+	if (!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/sound/rhel4migrated")) {
abdd45
+		purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/sound/rhel4migrated", TRUE);
abdd45
+		if(!strcmp(method, "automatic") ||
abdd45
+		   !strcmp(method, "esd") ||
abdd45
+		   !strcmp(method, "arts")) {
abdd45
+			purple_prefs_set_string(PIDGIN_PREFS_ROOT "/sound/method", "custom");
abdd45
+			purple_prefs_set_path(PIDGIN_PREFS_ROOT "/sound/command", "aplay %s");
abdd45
+		}
abdd45
+	}
abdd45
+#endif
abdd45
+
abdd45
 #ifndef _WIN32
abdd45
 	if (!strcmp(method, "custom")) {
abdd45
 		const char *sound_cmd;