aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-theme-adium.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2010-03-04 23:37:48 +0800
committerXavier Claessens <xclaesse@gmail.com>2010-03-04 23:37:48 +0800
commit56872bd8f7c14cdb9a6cd303db3d21b008a6f07a (patch)
tree37062b06b4a0ff9f69d27cd6d11d1762f42d3324 /libempathy-gtk/empathy-theme-adium.c
parent3b09acab5942361ac9ab12dc0a3bbbd10ffa42d7 (diff)
parent7c9a7e0a126322fea64c7a4dfcd455400cafcbe8 (diff)
downloadgsoc2013-empathy-56872bd8f7c14cdb9a6cd303db3d21b008a6f07a.tar
gsoc2013-empathy-56872bd8f7c14cdb9a6cd303db3d21b008a6f07a.tar.gz
gsoc2013-empathy-56872bd8f7c14cdb9a6cd303db3d21b008a6f07a.tar.bz2
gsoc2013-empathy-56872bd8f7c14cdb9a6cd303db3d21b008a6f07a.tar.lz
gsoc2013-empathy-56872bd8f7c14cdb9a6cd303db3d21b008a6f07a.tar.xz
gsoc2013-empathy-56872bd8f7c14cdb9a6cd303db3d21b008a6f07a.tar.zst
gsoc2013-empathy-56872bd8f7c14cdb9a6cd303db3d21b008a6f07a.zip
Merge branch 'clickable-link'
Diffstat (limited to 'libempathy-gtk/empathy-theme-adium.c')
-rw-r--r--libempathy-gtk/empathy-theme-adium.c47
1 files changed, 5 insertions, 42 deletions
diff --git a/libempathy-gtk/empathy-theme-adium.c b/libempathy-gtk/empathy-theme-adium.c
index 5c67af857..7736be270 100644
--- a/libempathy-gtk/empathy-theme-adium.c
+++ b/libempathy-gtk/empathy-theme-adium.c
@@ -40,6 +40,7 @@
#include "empathy-conf.h"
#include "empathy-ui-utils.h"
#include "empathy-plist.h"
+#include "empathy-string-parser.h"
#define DEBUG_FLAG EMPATHY_DEBUG_CHAT
#include <libempathy/empathy-debug.h>
@@ -221,30 +222,6 @@ theme_adium_match_newline (const gchar *text,
}
static void
-theme_adium_replace_link (const gchar *text,
- gssize len,
- gpointer match_data,
- gpointer user_data)
-{
- GString *string = user_data;
- gchar *real_url;
- gchar *escaped;
-
- real_url = empathy_make_absolute_url_len (text, len);
-
- /* The thing we are making a link of may contain
- * characters which need escaping */
- escaped = g_markup_escape_text (text, len);
-
- /* Append the link inside <a href=""></a> tag */
- g_string_append_printf (string, "<a href=\"%s\">%s</a>",
- real_url, escaped);
-
- g_free (real_url);
- g_free (escaped);
-}
-
-static void
theme_adium_replace_smiley (const gchar *text,
gssize len,
gpointer match_data,
@@ -259,32 +236,18 @@ theme_adium_replace_smiley (const gchar *text,
hit->path, (int)len, text, (int)len, text);
}
-static void
-theme_adium_replace_escaped (const gchar *text,
- gssize len,
- gpointer match_data,
- gpointer user_data)
-{
- GString *string = user_data;
- gchar *escaped;
-
- escaped = g_markup_escape_text (text, len);
- g_string_append (string, escaped);
- g_free (escaped);
-}
-
static EmpathyStringParser string_parsers[] = {
- {empathy_string_match_link, theme_adium_replace_link},
+ {empathy_string_match_link, empathy_string_replace_link},
{theme_adium_match_newline, NULL},
- {empathy_string_match_all, theme_adium_replace_escaped},
+ {empathy_string_match_all, empathy_string_replace_escaped},
{NULL, NULL}
};
static EmpathyStringParser string_parsers_with_smiley[] = {
- {empathy_string_match_link, theme_adium_replace_link},
+ {empathy_string_match_link, empathy_string_replace_link},
{empathy_string_match_smiley, theme_adium_replace_smiley},
{theme_adium_match_newline, NULL},
- {empathy_string_match_all, theme_adium_replace_escaped},
+ {empathy_string_match_all, empathy_string_replace_escaped},
{NULL, NULL}
};