# HG changeset patch # User Yoshiki Yazawa # Date 1255589352 -32400 # Node ID 9f78fb6bfc7606a6f111fab40e319e90200044e1 # Parent 8de140bc8d13ec1b762accf9682ef94f7685f052 gtkimhtml easily be fooled if the buffer is not entity markuped. diff -r 8de140bc8d13 -r 9f78fb6bfc76 main.c --- a/main.c Wed Oct 14 14:55:55 2009 +0900 +++ b/main.c Thu Oct 15 15:49:12 2009 +0900 @@ -363,6 +363,7 @@ gint service = get_service_type(conv); gchar *linkstr = NULL, *tmpstr = NULL; + gchar *escaped = NULL; /* check if the conversation is between twitter */ if(service == unknown_service) @@ -398,10 +399,24 @@ } } /* send */ + + /* note: + link string needs stripped plain text. + displaying needs markup-escaped that text. */ + /* strip all markups */ -// strip_markup(buffer, TRUE); strip_markup(buffer, FALSE); + /* make R F RT link string */ + if(service == twitter_service) + linkstr = twitter_rip_link_string(buffer); + + /* entity markup for displaying */ + escaped = g_markup_escape_text(*buffer, -1); + g_free(*buffer); + *buffer = escaped; + + /* playsound */ if(purple_prefs_get_bool(OPT_PLAYSOUND_SENDER)) { playsound(buffer, SENDER); @@ -410,10 +425,6 @@ playsound(buffer, RECIPIENT); } - /* make R F RT link */ - if(service == twitter_service) - linkstr = twitter_make_link_string(buffer); - /* translate */ if(purple_prefs_get_bool(OPT_TRANSLATE_SENDER)) { if(service == ffeed_service) diff -r 8de140bc8d13 -r 9f78fb6bfc76 util.c --- a/util.c Wed Oct 14 14:55:55 2009 +0900 +++ b/util.c Thu Oct 15 15:49:12 2009 +0900 @@ -521,7 +521,7 @@ } gchar * -twitter_make_link_string(gchar **str) +twitter_rip_link_string(gchar **str) { GMatchInfo *match_info = NULL; gchar *boddy0 = NULL, *boddy = NULL; diff -r 8de140bc8d13 -r 9f78fb6bfc76 util.h --- a/util.h Wed Oct 14 14:55:55 2009 +0900 +++ b/util.h Thu Oct 15 15:49:12 2009 +0900 @@ -5,7 +5,7 @@ void strip_markup(gchar **str, gboolean escape); gchar *strip_html_markup(const gchar *src); gboolean ensure_path_exists(const char *dir); -gchar *twitter_make_link_string(gchar **str); +gchar *twitter_rip_link_string(gchar **str); gboolean is_twitter_conv(PurpleConversation *conv); gboolean is_wassr_account(PurpleAccount *account, const char *name);