[empathy] event-manager: only display incoming messages in notification



commit 3faa1f894ae25830ba4fbdf4d8d7f016f28cbcdf
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Wed Mar 23 15:01:54 2011 +0100

    event-manager: only display incoming messages in notification
    
    If not, we display outgoing ones as well if the user uses Shell's message tray
    to reply.

 src/empathy-event-manager.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/empathy-event-manager.c b/src/empathy-event-manager.c
index 599a6a4..799e91a 100644
--- a/src/empathy-event-manager.c
+++ b/src/empathy-event-manager.c
@@ -562,7 +562,7 @@ event_manager_chat_message_received_cb (EmpathyTpChat *tp_chat,
   EmpathyMessage *message,
   EventManagerApproval *approval)
 {
-  GtkWidget       *window = empathy_main_window_dup ();
+  GtkWidget       *window;
   EmpathyContact  *sender;
   const gchar     *header;
   const gchar     *msg;
@@ -575,6 +575,11 @@ event_manager_chat_message_received_cb (EmpathyTpChat *tp_chat,
   event = event_lookup_by_approval (approval->manager, approval);
 
   sender = empathy_message_get_sender (message);
+
+  /* We only want to show incoming messages */
+  if (empathy_contact_is_user (sender))
+    return;
+
   header = empathy_contact_get_alias (sender);
   msg = empathy_message_get_body (message);
 
@@ -588,6 +593,8 @@ event_manager_chat_message_received_cb (EmpathyTpChat *tp_chat,
         EMPATHY_EVENT_TYPE_CHAT, EMPATHY_IMAGE_NEW_MESSAGE, header, msg,
         approval, event_text_channel_process_func, NULL);
 
+  window = empathy_main_window_dup ();
+
   empathy_sound_manager_play (priv->sound_mgr, window,
       EMPATHY_SOUND_CONVERSATION_NEW);
 



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