aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-05-28 06:56:37 +0800
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-05-28 06:56:37 +0800
commit05a941a4b071189b819faf9c5a8b54712b2d5467 (patch)
treedd277cda307872460a3ac0a99aab14773e33133e /src
parent6265c301144866873f49851d850ba66fcde3bd8c (diff)
downloadgsoc2013-empathy-05a941a4b071189b819faf9c5a8b54712b2d5467.tar
gsoc2013-empathy-05a941a4b071189b819faf9c5a8b54712b2d5467.tar.gz
gsoc2013-empathy-05a941a4b071189b819faf9c5a8b54712b2d5467.tar.bz2
gsoc2013-empathy-05a941a4b071189b819faf9c5a8b54712b2d5467.tar.lz
gsoc2013-empathy-05a941a4b071189b819faf9c5a8b54712b2d5467.tar.xz
gsoc2013-empathy-05a941a4b071189b819faf9c5a8b54712b2d5467.tar.zst
gsoc2013-empathy-05a941a4b071189b819faf9c5a8b54712b2d5467.zip
Only do sounds/notifications for text messages when they involve the user
When in a chatroom notifications and sounds should only happen when the users is part of the message (either someone is speaking to them or referring to them), otherwise the user will go crazy when in a lot of different muc channels. For a peer to peer text channel, all messages sent are targetted at the user so always do sounds/notifications in that case.
Diffstat (limited to 'src')
-rw-r--r--src/empathy-chat-window.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index 0ac5f4e84..1912b1b9a 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -926,24 +926,15 @@ chat_window_new_message_cb (EmpathyChat *chat,
/* - 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
+ * preferences 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_contact_is_user (sender)) {
empathy_sound_play (GTK_WIDGET (priv->dialog),
EMPATHY_SOUND_MESSAGE_OUTGOING);
- } else {
- if ((!has_focus || priv->current_chat != chat)) {
- empathy_sound_play (GTK_WIDGET (priv->dialog),
- EMPATHY_SOUND_MESSAGE_INCOMING);
- }
- }
-
- if (!has_focus) {
- chat_window_show_or_update_notification (window, message, chat);
}
if (has_focus && priv->current_chat == chat) {
@@ -962,8 +953,13 @@ chat_window_new_message_cb (EmpathyChat *chat,
needs_urgency = TRUE;
}
- if (needs_urgency && !has_focus) {
- chat_window_set_urgency_hint (window, TRUE);
+ if (needs_urgency) {
+ if (!has_focus)
+ chat_window_set_urgency_hint (window, TRUE);
+
+ empathy_sound_play (GTK_WIDGET (priv->dialog),
+ EMPATHY_SOUND_MESSAGE_INCOMING);
+ chat_window_show_or_update_notification (window, message, chat);
}
if (!g_list_find (priv->chats_new_msg, chat)) {