aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2011-05-04 20:30:02 +0800
committerXavier Claessens <xclaesse@gmail.com>2011-05-04 20:30:56 +0800
commit3eef7be07ed7873e1f95571082eb6c2319e0b9b3 (patch)
treec22bfcb29509edf1183606d0fb8a3f4cc11a1e9a /libempathy-gtk
parentd26565223775beb169f46c315f8c09d1de0b85da (diff)
downloadgsoc2013-empathy-3eef7be07ed7873e1f95571082eb6c2319e0b9b3.tar
gsoc2013-empathy-3eef7be07ed7873e1f95571082eb6c2319e0b9b3.tar.gz
gsoc2013-empathy-3eef7be07ed7873e1f95571082eb6c2319e0b9b3.tar.bz2
gsoc2013-empathy-3eef7be07ed7873e1f95571082eb6c2319e0b9b3.tar.lz
gsoc2013-empathy-3eef7be07ed7873e1f95571082eb6c2319e0b9b3.tar.xz
gsoc2013-empathy-3eef7be07ed7873e1f95571082eb6c2319e0b9b3.tar.zst
gsoc2013-empathy-3eef7be07ed7873e1f95571082eb6c2319e0b9b3.zip
Adium: Correctly support action messages (/me)
Fixes bug #649367
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-theme-adium.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/libempathy-gtk/empathy-theme-adium.c b/libempathy-gtk/empathy-theme-adium.c
index f7f37206f..e6cf03c86 100644
--- a/libempathy-gtk/empathy-theme-adium.c
+++ b/libempathy-gtk/empathy-theme-adium.c
@@ -667,6 +667,7 @@ theme_adium_append_message (EmpathyChatView *view,
GString *message_classes = NULL;
gboolean is_backlog;
gboolean consecutive;
+ gboolean action;
if (priv->pages_loading != 0) {
GValue *value = tp_g_value_slice_new (EMPATHY_TYPE_MESSAGE);
@@ -687,17 +688,21 @@ theme_adium_append_message (EmpathyChatView *view,
body_escaped = theme_adium_parse_body (theme, body);
name = empathy_contact_get_alias (sender);
contact_id = empathy_contact_get_id (sender);
+ action = (empathy_message_get_tptype (msg) == TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION);
- /* If this is a /me, append an event */
- if (empathy_message_get_tptype (msg) == TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION) {
+ /* If this is a /me probably */
+ if (action) {
gchar *str;
- str = g_strdup_printf ("%s %s", name, body_escaped);
- theme_adium_append_event_escaped (view, str);
-
- g_free (str);
+ if (priv->data->version >= 4 || !priv->data->custom_template) {
+ str = g_strdup_printf ("<span class='actionMessageUserName'>%s</span>"
+ "<span class='actionMessageBody'>%s</span>",
+ name, body_escaped);
+ } else {
+ str = g_strdup_printf ("*%s*", body_escaped);
+ }
g_free (body_escaped);
- return;
+ body_escaped = str;
}
/* Get the avatar filename, or a fallback */
@@ -763,6 +768,9 @@ theme_adium_append_message (EmpathyChatView *view,
if (empathy_message_get_tptype (msg) == TP_CHANNEL_TEXT_MESSAGE_TYPE_AUTO_REPLY) {
g_string_append (message_classes, " autoreply");
}
+ if (action) {
+ g_string_append (message_classes, " action");
+ }
/* FIXME: other classes:
* status - the message is a status change
* event - the message is a notification of something happening