comparison finch/gntsound.c @ 19447:1a9b30a95fa6

Fix #2767 (per-conversation/chat mute option). My limited testing makes me think it's working!
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sun, 26 Aug 2007 09:39:54 +0000
parents b80379b1f3c6
children 44b4e8bd759b
comparison
equal deleted inserted replaced
19446:5d200fce4170 19447:1a9b30a95fa6
38 #include "notify.h" 38 #include "notify.h"
39 #include "prefs.h" 39 #include "prefs.h"
40 #include "sound.h" 40 #include "sound.h"
41 #include "util.h" 41 #include "util.h"
42 42
43 #include "gntconv.h"
44
43 #include "gntbox.h" 45 #include "gntbox.h"
44 #include "gntwindow.h" 46 #include "gntwindow.h"
45 #include "gntcombobox.h" 47 #include "gntcombobox.h"
46 #include "gntlabel.h" 48 #include "gntlabel.h"
47 #include "gntconv.h" 49 #include "gntconv.h"
171 173
172 gntconv = FINCH_CONV(conv); 174 gntconv = FINCH_CONV(conv);
173 175
174 has_focus = purple_conversation_has_focus(conv); 176 has_focus = purple_conversation_has_focus(conv);
175 177
176 if (has_focus && !purple_prefs_get_bool(make_pref("/conv_focus"))) 178 if ((gntconv->flags & FINCH_CONV_NO_SOUND) ||
179 (has_focus && !purple_prefs_get_bool(make_pref("/conv_focus"))))
177 { 180 {
178 return; 181 return;
179 } 182 }
180 } 183 }
181 184
1059 g_signal_connect(G_OBJECT(win), "destroy", G_CALLBACK(release_pref_dialog), NULL); 1062 g_signal_connect(G_OBJECT(win), "destroy", G_CALLBACK(release_pref_dialog), NULL);
1060 1063
1061 load_pref_window(finch_sound_get_active_profile()); 1064 load_pref_window(finch_sound_get_active_profile());
1062 1065
1063 gnt_widget_show(win); 1066 gnt_widget_show(win);
1064 } 1067 }
1068
1069 gboolean finch_sound_is_enabled(void)
1070 {
1071 const char *pref = make_pref("/method");
1072 const char *method = purple_prefs_get_string(pref);
1073
1074 if (!method)
1075 return FALSE;
1076 if (strcmp(method, "nosound") == 0)
1077 return FALSE;
1078 if (purple_prefs_get_int(make_pref("/volume")) <= 0)
1079 return FALSE;
1080
1081 return TRUE;
1082 }
1065 1083
1066 static PurpleSoundUiOps sound_ui_ops = 1084 static PurpleSoundUiOps sound_ui_ops =
1067 { 1085 {
1068 finch_sound_init, 1086 finch_sound_init,
1069 finch_sound_uninit, 1087 finch_sound_uninit,