[empathy: 6/10] Make links clickable in presence message and topics



commit 00ab069a55f05f0203bf58f071fa7adc54b6e9ac
Author: Xavier Claessens <xclaesse gmail com>
Date:   Wed Mar 3 16:17:37 2010 +0100

    Make links clickable in presence message and topics
    
    Fixes bug #525576

 libempathy-gtk/empathy-chat.c           |    8 +++++++-
 libempathy-gtk/empathy-contact-widget.c |   18 ++++++++++++++++--
 2 files changed, 23 insertions(+), 3 deletions(-)
---
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index bec1d77..4db9e45 100644
--- a/libempathy-gtk/empathy-chat.c
+++ b/libempathy-gtk/empathy-chat.c
@@ -56,6 +56,7 @@
 #include "empathy-theme-manager.h"
 #include "empathy-smiley-manager.h"
 #include "empathy-ui-utils.h"
+#include "empathy-string-parser.h"
 
 #define DEBUG_FLAG EMPATHY_DEBUG_CHAT
 #include <libempathy/empathy-debug.h>
@@ -1212,7 +1213,12 @@ chat_property_changed_cb (EmpathyTpChat *tp_chat,
 		if (EMP_STR_EMPTY (priv->subject)) {
 			gtk_widget_hide (priv->hbox_topic);
 		} else {
-			gtk_label_set_text (GTK_LABEL (priv->label_topic), priv->subject);
+			gchar *markup_text;
+
+			markup_text = empathy_add_link_markup (priv->subject);
+			gtk_label_set_markup (GTK_LABEL (priv->label_topic), markup_text);
+			g_free (markup_text);
+
 			gtk_widget_show (priv->hbox_topic);
 		}
 		if (priv->block_events_timeout_id == 0) {
diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c
index 9cb493f..500a387 100644
--- a/libempathy-gtk/empathy-contact-widget.c
+++ b/libempathy-gtk/empathy-contact-widget.c
@@ -47,6 +47,7 @@
 #include "empathy-avatar-chooser.h"
 #include "empathy-avatar-image.h"
 #include "empathy-ui-utils.h"
+#include "empathy-string-parser.h"
 #include "empathy-kludge-label.h"
 
 #define DEBUG_FLAG EMPATHY_DEBUG_CONTACT
@@ -948,8 +949,21 @@ contact_widget_name_notify_cb (EmpathyContactWidget *information)
 static void
 contact_widget_presence_notify_cb (EmpathyContactWidget *information)
 {
-  gtk_label_set_text (GTK_LABEL (information->label_status),
-      empathy_contact_get_status (information->contact));
+  const gchar *status;
+
+  status = empathy_contact_get_status (information->contact);
+  if (!(information->flags & EMPATHY_CONTACT_WIDGET_FOR_TOOLTIP))
+    {
+      gchar *markup_text;
+
+      markup_text = empathy_add_link_markup (status);
+      gtk_label_set_markup (GTK_LABEL (information->label_status), markup_text);
+      g_free (markup_text);
+  }
+  else {
+    gtk_label_set_text (GTK_LABEL (information->label_status), status);
+  }
+
   gtk_image_set_from_icon_name (GTK_IMAGE (information->image_state),
       empathy_icon_name_for_contact (information->contact),
       GTK_ICON_SIZE_BUTTON);



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