# HG changeset patch # User Yoshiki Yazawa # Date 1218698422 -32400 # Node ID bc1448e72b1b5a80a2eb82dd18d18e7815a5ab45 # Parent d66ad33431197db95d66f5a0877522c5e40d52b3 workaround for that wassr sometimes provides 128 pixel icon with broad white borders. diff -r d66ad3343119 -r bc1448e72b1b pidgin-twitter.c --- a/pidgin-twitter.c Wed Aug 13 15:51:23 2008 +0900 +++ b/pidgin-twitter.c Thu Aug 14 16:20:22 2008 +0900 @@ -24,7 +24,7 @@ /***********/ /* globals */ /***********/ -#define NUM_REGPS 12 +#define NUM_REGPS 13 #define NUM_SERVICES 3 /* twitter, wassr, identica. */ static GRegex *regp[NUM_REGPS]; static gboolean suppress_oops = FALSE; @@ -1807,7 +1807,12 @@ tmp = g_strdup_printf("%s/%s", url, purple_url_encode(slash+1)); else if(service == wassr_service) { - tmp = g_strdup_printf("http://wassr.jp%s/%s", url, slash+1); + gchar *tmp0 = NULL; + tmp0 = g_regex_replace(regp[SIZE_128_WASSR], slash+1, + -1, 0, ".64.", 0, NULL); + tmp = g_strdup_printf("http://wassr.jp%s/%s", url, + tmp0 ? tmp0 : slash+1); + g_free(tmp0); } else { tmp = g_strdup_printf("%s/%s", url, slash+1); @@ -2425,6 +2430,7 @@ regp[IMAGE_WASSR] = g_regex_new(P_IMAGE_WASSR, 0, 0, NULL); regp[IMAGE_IDENTICA] = g_regex_new(P_IMAGE_IDENTICA, 0, 0, NULL); regp[TAG_IDENTICA] = g_regex_new(P_TAG_IDENTICA, 0, 0, NULL); + regp[SIZE_128_WASSR] = g_regex_new(P_SIZE_128_WASSR, 0, 0, NULL); for(i = twitter_service; i < NUM_SERVICES; i++) { icon_hash[i] = g_hash_table_new_full(g_str_hash, g_str_equal, diff -r d66ad3343119 -r bc1448e72b1b pidgin-twitter.h --- a/pidgin-twitter.h Wed Aug 13 15:51:23 2008 +0900 +++ b/pidgin-twitter.h Thu Aug 14 16:20:22 2008 +0900 @@ -37,7 +37,8 @@ IMAGE_TWITTER, IMAGE_WASSR, IMAGE_IDENTICA, - TAG_IDENTICA + TAG_IDENTICA, + SIZE_128_WASSR }; /* service id */ @@ -149,7 +150,7 @@ #define P_IMAGE_WASSR "
" #define P_IMAGE_IDENTICA "\"[A-Za-z0-0_]+\"/" #define P_TAG_IDENTICA "#([A-Za-z0-9]+)" - +#define P_SIZE_128_WASSR "\\.128\\." /* twitter API specific macros */ #define TWITTER_BASE_URL "http://twitter.com"