diff options
author | Pierre-Luc Beaudoin <pierre-luc.beaudoin@collabora.co.uk> | 2009-08-18 08:16:18 +0800 |
---|---|---|
committer | Pierre-Luc Beaudoin <pierre-luc.beaudoin@collabora.co.uk> | 2009-08-19 00:50:57 +0800 |
commit | f0a0befc9453c490d9db7c820708b49481c30f96 (patch) | |
tree | ee68ee81def548847d90bd23479ef9a917ced3fd | |
parent | fbec34e1aa516010e9aa037c8203dd2dbe6f1cee (diff) | |
download | gsoc2013-empathy-f0a0befc9453c490d9db7c820708b49481c30f96.tar gsoc2013-empathy-f0a0befc9453c490d9db7c820708b49481c30f96.tar.gz gsoc2013-empathy-f0a0befc9453c490d9db7c820708b49481c30f96.tar.bz2 gsoc2013-empathy-f0a0befc9453c490d9db7c820708b49481c30f96.tar.lz gsoc2013-empathy-f0a0befc9453c490d9db7c820708b49481c30f96.tar.xz gsoc2013-empathy-f0a0befc9453c490d9db7c820708b49481c30f96.tar.zst gsoc2013-empathy-f0a0befc9453c490d9db7c820708b49481c30f96.zip |
Don't check for smileys in urls
Moving the smiley detection after the url detection and
only if not url is found. (similar to what regular themes
do)
-rw-r--r-- | libempathy-gtk/empathy-theme-adium.c | 53 |
1 files changed, 26 insertions, 27 deletions
diff --git a/libempathy-gtk/empathy-theme-adium.c b/libempathy-gtk/empathy-theme-adium.c index e9548f303..c5fec06e5 100644 --- a/libempathy-gtk/empathy-theme-adium.c +++ b/libempathy-gtk/empathy-theme-adium.c @@ -299,33 +299,6 @@ theme_adium_parse_body (EmpathyThemeAdium *theme, EMPATHY_PREFS_CHAT_SHOW_SMILEYS, &use_smileys); - if (use_smileys) { - /* Replace smileys by a <img/> tag */ - string = g_string_sized_new (strlen (text)); - smileys = empathy_smiley_manager_parse (priv->smiley_manager, text); - for (l = smileys; l; l = l->next) { - EmpathySmiley *smiley; - - smiley = l->data; - if (smiley->path) { - g_string_append_printf (string, - "<abbr title='%s'><img src=\"%s\"/ alt=\"%s\"/></abbr>", - smiley->str, smiley->path, smiley->str); - } else { - gchar *str; - - str = g_markup_escape_text (smiley->str, -1); - g_string_append (string, str); - g_free (str); - } - empathy_smiley_free (smiley); - } - g_slist_free (smileys); - - g_free (ret); - text = ret = g_string_free (string, FALSE); - } - /* Add <a href></a> arround links */ uri_regex = empathy_uri_regex_dup_singleton (); match = g_regex_match (uri_regex, text, 0, &match_info); @@ -360,7 +333,33 @@ theme_adium_parse_body (EmpathyThemeAdium *theme, g_free (ret); text = ret = g_string_free (string, FALSE); + } else if (use_smileys) { + /* Replace smileys by a <img/> tag */ + string = g_string_sized_new (strlen (text)); + smileys = empathy_smiley_manager_parse (priv->smiley_manager, text); + for (l = smileys; l; l = l->next) { + EmpathySmiley *smiley; + + smiley = l->data; + if (smiley->path) { + g_string_append_printf (string, + "<abbr title='%s'><img src=\"%s\"/ alt=\"%s\"/></abbr>", + smiley->str, smiley->path, smiley->str); + } else { + gchar *str; + + str = g_markup_escape_text (smiley->str, -1); + g_string_append (string, str); + g_free (str); + } + empathy_smiley_free (smiley); + } + g_slist_free (smileys); + + g_free (ret); + text = ret = g_string_free (string, FALSE); } + g_match_info_free (match_info); g_regex_unref (uri_regex); |