aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-chat-window.c
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-07-28 17:20:27 +0800
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-07-28 17:20:27 +0800
commit1d153c1cf91edce537bc64efb01b5a496b35518e (patch)
treede8ba4359a0341bd0c8c6e1a7495f4f39fb565f1 /src/empathy-chat-window.c
parentb50b7039d3b52f33df94e5a3526d9f43a51401ad (diff)
parent6df1c4bdd81fbbb288b8e49c3bea9a1dd2e005a6 (diff)
downloadgsoc2013-empathy-1d153c1cf91edce537bc64efb01b5a496b35518e.tar
gsoc2013-empathy-1d153c1cf91edce537bc64efb01b5a496b35518e.tar.gz
gsoc2013-empathy-1d153c1cf91edce537bc64efb01b5a496b35518e.tar.bz2
gsoc2013-empathy-1d153c1cf91edce537bc64efb01b5a496b35518e.tar.lz
gsoc2013-empathy-1d153c1cf91edce537bc64efb01b5a496b35518e.tar.xz
gsoc2013-empathy-1d153c1cf91edce537bc64efb01b5a496b35518e.tar.zst
gsoc2013-empathy-1d153c1cf91edce537bc64efb01b5a496b35518e.zip
Merge commit 'upstream/master' into mc5
Conflicts: libempathy-gtk/empathy-account-widget.c src/empathy.c
Diffstat (limited to 'src/empathy-chat-window.c')
-rw-r--r--src/empathy-chat-window.c38
1 files changed, 29 insertions, 9 deletions
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index 937e68aff..03644026b 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -175,7 +175,7 @@ chat_tab_style_set_cb (GtkWidget *hbox,
"chat-window-tab-close-button");
context = gtk_widget_get_pango_context (hbox);
- metrics = pango_context_get_metrics (context, hbox->style->font_desc,
+ metrics = pango_context_get_metrics (context, gtk_widget_get_style (hbox)->font_desc,
pango_context_get_language (context));
char_width = pango_font_metrics_get_approximate_char_width (metrics);
pango_font_metrics_unref (metrics);
@@ -994,6 +994,24 @@ chat_window_show_or_update_notification (EmpathyChatWindow *window,
}
static void
+chat_window_set_highlight_room_tab_label (EmpathyChat *chat)
+{
+ gchar *markup;
+ GtkWidget *widget;
+
+ if (empathy_chat_is_room (chat) == FALSE)
+ return;
+
+ markup = g_markup_printf_escaped ("<span color=\"%s\">%s</span>",
+ "red",
+ empathy_chat_get_name (chat));
+
+ widget = g_object_get_data (G_OBJECT (chat), "chat-window-tab-label");
+ gtk_label_set_markup (GTK_LABEL (widget), markup);
+ g_free (markup);
+}
+
+static void
chat_window_new_message_cb (EmpathyChat *chat,
EmpathyMessage *message,
EmpathyChatWindow *window)
@@ -1025,6 +1043,11 @@ chat_window_new_message_cb (EmpathyChat *chat,
return;
}
+ if (!g_list_find (priv->chats_new_msg, chat)) {
+ priv->chats_new_msg = g_list_prepend (priv->chats_new_msg, chat);
+ chat_window_update_chat_tab (chat);
+ }
+
/* If empathy_chat_is_room () returns TRUE, that means it's a named MUC.
* If empathy_chat_get_remote_contact () returns NULL, that means it's
* an unamed MUC (msn-like).
@@ -1038,18 +1061,15 @@ chat_window_new_message_cb (EmpathyChat *chat,
}
if (needs_urgency) {
- if (!has_focus)
+ if (!has_focus) {
chat_window_set_urgency_hint (window, TRUE);
+ chat_window_set_highlight_room_tab_label (chat);
+ }
empathy_sound_play (GTK_WIDGET (priv->dialog),
EMPATHY_SOUND_MESSAGE_INCOMING);
chat_window_show_or_update_notification (window, message, chat);
}
-
- if (!g_list_find (priv->chats_new_msg, chat)) {
- priv->chats_new_msg = g_list_prepend (priv->chats_new_msg, chat);
- chat_window_update_chat_tab (chat);
- }
}
static GtkNotebook *
@@ -1241,7 +1261,7 @@ chat_window_drag_data_received (GtkWidget *widget,
const gchar *account_id;
const gchar *contact_id;
- id = (const gchar*) selection->data;
+ id = (const gchar*) gtk_selection_data_get_data (selection);
account_manager = empathy_account_manager_dup_singleton ();
DEBUG ("DND contact from roster with id:'%s'", id);
@@ -1298,7 +1318,7 @@ chat_window_drag_data_received (GtkWidget *widget,
DEBUG ("DND tab");
- chat = (void *) selection->data;
+ chat = (void *) gtk_selection_data_get_data (selection);
old_window = chat_window_find_chat (*chat);
if (old_window) {