Blame SOURCES/pidgin-NOT-UPSTREAM-2.5.2-rhel4-sound-migration.patch

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