Empathy Hard code freeze exception request: outgoing messages displayed in notification bubbles



I did some gnome-shell / Empathy integration tests and noticed this bug:
- receive a new message from Alice
- Answer from Shell's tray icon (NOT from Empathy's chat window)
- Your answer is displayed in a notification bubble

That's because, from an Telepathy pov, the channel is still pending.
I fixed this in this branch which has already been reviewed by Emilio.

http://git.collabora.co.uk/?p=user/cassidy/empathy;a=shortlog;h=refs/heads/echo-message


	G.


-- 
Guillaume Desmottes <gdesmott gnome org>
Jabber <cassidy jabber belnet be>
GPG 1024D/711E31B1 | 1B5A 1BA8 11AA F0F1 2169  E28A AC55 8671 711E 31B1
>From 45bf27fa1f3785acfcd0b86757a5517dbcab0e0c Mon Sep 17 00:00:00 2001
From: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Wed, 23 Mar 2011 15:01:54 +0100
Subject: [PATCH] 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);
 
-- 
1.7.4.1



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