[empathy] don't display 'No topic defined' if topic are not supported



commit 6de7927ded5e15783b4d9d93233856d9bd373641
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Mon Jan 23 15:27:50 2012 +0100

    don't display 'No topic defined' if topic are not supported
    
    https://bugzilla.gnome.org/show_bug.cgi?id=668502

 libempathy-gtk/empathy-chat.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index 1496f58..be5d71e 100644
--- a/libempathy-gtk/empathy-chat.c
+++ b/libempathy-gtk/empathy-chat.c
@@ -1604,15 +1604,19 @@ chat_subject_changed_cb (EmpathyChat *chat)
 			gtk_widget_show (priv->hbox_topic);
 		}
 		if (priv->block_events_timeout_id == 0) {
-			gchar *str;
+			gchar *str = NULL;
 
 			if (!EMP_STR_EMPTY (priv->subject)) {
 				str = g_strdup_printf (_("Topic set to: %s"), priv->subject);
-			} else {
+			} else if (empathy_tp_chat_supports_subject (priv->tp_chat)) {
+				/* No need to display this 'event' is no topic can be defined anyway */
 				str = g_strdup (_("No topic defined"));
 			}
-			empathy_chat_view_append_event (EMPATHY_CHAT (chat)->view, str);
-			g_free (str);
+
+			if (str != NULL) {
+				empathy_chat_view_append_event (EMPATHY_CHAT (chat)->view, str);
+				g_free (str);
+			}
 		}
 }
 



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