diff options
author | Xavier Claessens <xclaesse@src.gnome.org> | 2009-01-07 00:46:01 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2009-01-07 00:46:01 +0800 |
commit | 6ef34909df59304871330b9311430eb4116873a5 (patch) | |
tree | f314e755a77fb598c2f5b635ebc5f1a1ba0b9dd6 /src/empathy-chat-window.c | |
parent | 7e38c381cd6e647e20b703973c9ed2c14f6ab543 (diff) | |
download | gsoc2013-empathy-6ef34909df59304871330b9311430eb4116873a5.tar gsoc2013-empathy-6ef34909df59304871330b9311430eb4116873a5.tar.gz gsoc2013-empathy-6ef34909df59304871330b9311430eb4116873a5.tar.bz2 gsoc2013-empathy-6ef34909df59304871330b9311430eb4116873a5.tar.lz gsoc2013-empathy-6ef34909df59304871330b9311430eb4116873a5.tar.xz gsoc2013-empathy-6ef34909df59304871330b9311430eb4116873a5.tar.zst gsoc2013-empathy-6ef34909df59304871330b9311430eb4116873a5.zip |
Adapt the libcanberra calls to use the new functions.
svn path=/trunk/; revision=2025
Diffstat (limited to 'src/empathy-chat-window.c')
-rw-r--r-- | src/empathy-chat-window.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c index b5e30d647..e1bd9075e 100644 --- a/src/empathy-chat-window.c +++ b/src/empathy-chat-window.c @@ -842,30 +842,34 @@ chat_window_new_message_cb (EmpathyChat *chat, EmpathyChatWindowPriv *priv; gboolean has_focus; gboolean needs_urgency; - gboolean action_sounds_enabled; EmpathyContact *sender; priv = GET_PRIV (window); has_focus = empathy_chat_window_has_focus (window); - empathy_conf_get_bool (empathy_conf_get (), - EMPATHY_PREFS_INPUT_FEEDBACK_SOUNDS, - &action_sounds_enabled); - /* always play sounds if enabled, otherwise only play if chat is not in focus */ - if (action_sounds_enabled || !has_focus || priv->current_chat != chat) { - sender = empathy_message_get_sender(message); - if (empathy_contact_is_user (sender) != FALSE) { + /* - if we're the sender, we play the sound if it's specified in the + * preferences and we're not away. + * - if we receive a message, we play the sound if it's specified in the + * prefereces and the window does not have focus on the chat receiving + * the message. + */ + + sender = empathy_message_get_sender (message); + + if (empathy_contact_is_user (sender) != FALSE) { + if (empathy_sound_pref_is_enabled (EMPATHY_PREFS_SOUNDS_OUTGOING_MESSAGE)) { ca_gtk_play_for_widget (GTK_WIDGET (priv->dialog), 0, - CA_PROP_EVENT_ID, "message-sent-instant", + CA_PROP_EVENT_ID, "message-sent-instant", CA_PROP_EVENT_DESCRIPTION, _("Sent an instant message"), - CA_PROP_APPLICATION_NAME, g_get_application_name (), NULL); - } else { + } + } else { + if ((!has_focus || priv->current_chat != chat) && + empathy_sound_pref_is_enabled (EMPATHY_PREFS_SOUNDS_INCOMING_MESSAGE)) { ca_gtk_play_for_widget (GTK_WIDGET (priv->dialog), 0, CA_PROP_EVENT_ID, "message-new-instant", CA_PROP_EVENT_DESCRIPTION, _("Received an instant message"), - CA_PROP_APPLICATION_NAME, g_get_application_name (), NULL); } } |