# HG changeset patch # User Yoshiki Yazawa # Date 1255852557 -32400 # Node ID 2b79bad516e624d21771548d85ef0b56ff551942 # Parent 6ee1ed15688c84ca30871369d9080683f7a6d051 - removed the evil hack - twitter no longer requires preceding white space on a hash tag diff -r 6ee1ed15688c -r 2b79bad516e6 main.c --- a/main.c Sun Oct 18 13:30:48 2009 +0900 +++ b/main.c Sun Oct 18 16:55:57 2009 +0900 @@ -228,7 +228,6 @@ else if(which == SENDER_FFEED) { gchar *match1 = g_match_info_fetch(match_info, 1); /* preceding CR|LF */ gchar *match2 = g_match_info_fetch(match_info, 2); /* sender */ - g_snprintf(sub, SUBST_BUF_SIZE, SENDER_FORMAT_FFEED, match1 ? match1: "", match2, match2); g_free(match1); @@ -237,25 +236,15 @@ else if(which == CHANNEL_WASSR && service == wassr_service) { gchar *match1 = g_match_info_fetch(match_info, 1); /* before channel */ gchar *match2 = g_match_info_fetch(match_info, 2); /* channel */ - g_snprintf(sub, SUBST_BUF_SIZE, CHANNEL_FORMAT_WASSR, match1 ? match1: "", match2, match2); g_free(match1); g_free(match2); } else if(which == TAG_TWITTER && service == twitter_service) { - gchar *match1 = g_match_info_fetch(match_info, 1); /* white space */ - gchar *match2 = g_match_info_fetch(match_info, 2); /* search tag */ - - /* search tag ambiguity hack */ - gchar *last; - last = match2 + strlen(match2) - 1; - if(g_ascii_ispunct(*last)) - *last = '\0'; - - g_snprintf(sub, SUBST_BUF_SIZE, TAG_FORMAT_TWITTER, match1 ? match1: "", match2, match2); - g_free(match1); - g_free(match2); + gchar *match = g_match_info_fetch(match_info, 1); /* search tag */ + g_snprintf(sub, SUBST_BUF_SIZE, TAG_FORMAT_TWITTER, match, match); + g_free(match); } else if(which == TAG_IDENTICA && service == identica_service) { gchar *match = g_match_info_fetch(match_info, 1); diff -r 6ee1ed15688c -r 2b79bad516e6 pidgin-twitter.h --- a/pidgin-twitter.h Sun Oct 18 13:30:48 2009 +0900 +++ b/pidgin-twitter.h Sun Oct 18 16:55:57 2009 +0900 @@ -169,7 +169,7 @@ #define SENDER_FORMAT_FFEED "%s%s: " #define CHANNEL_FORMAT_WASSR "%s%s " #define CHANNEL_FORMAT_IDENTICA "%s%s " -#define TAG_FORMAT_TWITTER "%s#%s" +#define TAG_FORMAT_TWITTER "#%s" #define TAG_FORMAT_IDENTICA "#%s" #define GROUP_FORMAT_IDENTICA "!%s" #define LINK_FORMAT_TWITTER " R F RT" @@ -186,7 +186,7 @@ #define P_PSEUDO "^\\s*(?:[\"#$%&'()*+,\\-./:;<=>?\\[\\\\\\]_`{|}~]|[^\\s\\x21-\\x7E])*([dDfFgGlLmMnNtTwW]{1})(?:\\Z|\\s+|[^\\x21-\\x7E]+\\Z)" #define P_USER "^.*?(?:)?([-A-Za-z0-9_]+)(?:)?:" #define P_CHANNEL "^(.*?(?:)?[-A-Za-z0-9_]+(?:)?: \\r?\\n?#)([A-Za-z0-9_]+) " -#define P_TAG_TWITTER "(^|\\s+)#([^-A-Za-z0-9_]*[-A-Za-z0-9_]+\\S*)" +#define P_TAG_TWITTER "#([^-A-Za-z0-9_]*[-A-Za-z0-9_]+[^\\s[:punct:]]*)" #define P_TAG_IDENTICA "#([-A-Za-z0-9_]+)" #define P_GROUP_IDENTICA "!([-A-Za-z0-9_]+)" #define P_IMAGE_TWITTER "(https?://.+?)"