diff options
author | Will Thompson <will@willthompson.co.uk> | 2012-01-26 00:01:32 +0800 |
---|---|---|
committer | Will Thompson <will@willthompson.co.uk> | 2012-01-26 00:01:32 +0800 |
commit | ddd8a9a000833d87260f81c4459063b32e2e14e7 (patch) | |
tree | e41b456cfd9857fec9f122be2fdd94cc4da07eab /libempathy-gtk/empathy-theme-adium.c | |
parent | 6b453cffcd14296f9625eb54af7cb87dc75c9c5f (diff) | |
parent | cb4d7495d1ed8fabe40e552a4107ce6398814323 (diff) | |
download | gsoc2013-empathy-ddd8a9a000833d87260f81c4459063b32e2e14e7.tar gsoc2013-empathy-ddd8a9a000833d87260f81c4459063b32e2e14e7.tar.gz gsoc2013-empathy-ddd8a9a000833d87260f81c4459063b32e2e14e7.tar.bz2 gsoc2013-empathy-ddd8a9a000833d87260f81c4459063b32e2e14e7.tar.lz gsoc2013-empathy-ddd8a9a000833d87260f81c4459063b32e2e14e7.tar.xz gsoc2013-empathy-ddd8a9a000833d87260f81c4459063b32e2e14e7.tar.zst gsoc2013-empathy-ddd8a9a000833d87260f81c4459063b32e2e14e7.zip |
Merge branch 'highlight-regex'
Diffstat (limited to 'libempathy-gtk/empathy-theme-adium.c')
-rw-r--r-- | libempathy-gtk/empathy-theme-adium.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/libempathy-gtk/empathy-theme-adium.c b/libempathy-gtk/empathy-theme-adium.c index 7b0cd2169..98df46b79 100644 --- a/libempathy-gtk/empathy-theme-adium.c +++ b/libempathy-gtk/empathy-theme-adium.c @@ -132,13 +132,15 @@ typedef struct { guint type; EmpathyMessage *msg; char *str; + gboolean should_highlight; } QueuedItem; static QueuedItem * queue_item (GQueue *queue, guint type, EmpathyMessage *msg, - const char *str) + const char *str, + gboolean should_highlight) { QueuedItem *item = g_slice_new0 (QueuedItem); @@ -146,6 +148,7 @@ queue_item (GQueue *queue, if (msg != NULL) item->msg = g_object_ref (msg); item->str = g_strdup (str); + item->should_highlight = should_highlight; g_queue_push_tail (queue, item); @@ -775,7 +778,8 @@ theme_adium_remove_all_focus_marks (EmpathyThemeAdium *theme) static void theme_adium_append_message (EmpathyChatView *view, - EmpathyMessage *msg) + EmpathyMessage *msg, + gboolean should_highlight) { EmpathyThemeAdium *theme = EMPATHY_THEME_ADIUM (view); EmpathyThemeAdiumPriv *priv = GET_PRIV (theme); @@ -797,7 +801,7 @@ theme_adium_append_message (EmpathyChatView *view, gboolean action; if (priv->pages_loading != 0) { - queue_item (&priv->message_queue, QUEUED_MESSAGE, msg, NULL); + queue_item (&priv->message_queue, QUEUED_MESSAGE, msg, NULL, should_highlight); return; } @@ -886,7 +890,7 @@ theme_adium_append_message (EmpathyChatView *view, } else { g_string_append (message_classes, " incoming"); } - if (empathy_message_should_highlight (msg)) { + if (should_highlight) { g_string_append (message_classes, " mention"); } if (empathy_message_get_tptype (msg) == TP_CHANNEL_TEXT_MESSAGE_TYPE_AUTO_REPLY) { @@ -975,7 +979,7 @@ theme_adium_append_event (EmpathyChatView *view, gchar *str_escaped; if (priv->pages_loading != 0) { - queue_item (&priv->message_queue, QUEUED_EVENT, NULL, str); + queue_item (&priv->message_queue, QUEUED_EVENT, NULL, str, FALSE); return; } @@ -1005,7 +1009,7 @@ theme_adium_edit_message (EmpathyChatView *view, GError *error = NULL; if (priv->pages_loading != 0) { - queue_item (&priv->message_queue, QUEUED_EDIT, message, NULL); + queue_item (&priv->message_queue, QUEUED_EDIT, message, NULL, FALSE); return; } @@ -1345,7 +1349,8 @@ theme_adium_load_finished_cb (WebKitWebView *view, switch (item->type) { case QUEUED_MESSAGE: - theme_adium_append_message (chat_view, item->msg); + theme_adium_append_message (chat_view, item->msg, + item->should_highlight); break; case QUEUED_EDIT: |