[empathy] chat-window: don't play sound for pending messages (#639302)



commit 6924c640f01c5ca55d1001ddc5c44a46d7baf948
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Wed Jan 12 13:09:28 2011 +0100

    chat-window: don't play sound for pending messages (#639302)
    
    They have already be notified by the Approver.

 src/empathy-chat-window.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index 5cb7ec4..2cf4e73 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -1454,13 +1454,14 @@ chat_window_new_message_cb (EmpathyChat       *chat,
 			chat_window_set_highlight_room_labels (chat);
 		}
 
-		empathy_sound_manager_play (priv->sound_mgr, GTK_WIDGET (priv->dialog),
-		    EMPATHY_SOUND_MESSAGE_INCOMING);
+		/* Pending messages have already been displayed and notified in the
+		* approver, so we don't display a notification and play a sound for those */
+		if (!pending) {
+			empathy_sound_manager_play (priv->sound_mgr, GTK_WIDGET (priv->dialog),
+				    EMPATHY_SOUND_MESSAGE_INCOMING);
 
-		/* Pending messages have already been displayed in the approver, so we don't
-		* display a notification for those. */
-		if (!pending)
 			chat_window_show_or_update_notification (window, message, chat);
+		}
 	}
 
 	/* update the number of unread messages and the window icon */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]