# HG changeset patch # User Yoshiki Yazawa # Date 1218256932 -32400 # Node ID b436d72447e837967b8d80c34f3d58d5f9295c45 # Parent 3e459b078788e581134d714c0fc3d70dfe020253 make use of got_page_cb to obtain icons for jisko. diff -r 3e459b078788 -r b436d72447e8 pidgin-twitter.c --- a/pidgin-twitter.c Sat Aug 09 12:20:29 2008 +0900 +++ b/pidgin-twitter.c Sat Aug 09 13:42:12 2008 +0900 @@ -24,9 +24,9 @@ /***********/ /* globals */ /***********/ -#define NUM_REGP 10 +#define NUM_REGPS 11 #define NUM_SERVICES 4 /* twitter, wassr, identica, jisko. */ -static GRegex *regp[NUM_REGP]; +static GRegex *regp[NUM_REGPS]; static gboolean suppress_oops = FALSE; static GHashTable *icon_hash[NUM_SERVICES]; static GHashTable *conv_hash = NULL; @@ -1791,12 +1791,16 @@ icon_hash[twitter_service], user_name); regp_id = IMAGE_TWITTER; } - - if(service == identica_service) { + else if(service == identica_service) { data = (icon_data *)g_hash_table_lookup( icon_hash[identica_service], user_name); regp_id = IMAGE_IDENTICA; } + else if(service == jisko_service) { + data = (icon_data *)g_hash_table_lookup( + icon_hash[jisko_service], user_name); + regp_id = IMAGE_JISKO; + } if(!url_text) { if(data) { @@ -2163,9 +2167,7 @@ url = g_strdup_printf("http://identi.ca/%s", user_name); break; case jisko_service: - url = g_strdup_printf("http://jisko.net/users/%s/img/avatar/thumb_side.png", - user_name); - data->img_type = "png"; + url = g_strdup_printf("http://jisko.net/%s", user_name); break; default: twitter_debug("unknown service\n"); @@ -2179,7 +2181,8 @@ /* gotdata will be released in got_icon_cb */ if(service == identica_service || - service == twitter_service) { + service == twitter_service || + service == jisko_service) { data->fetch_data = purple_util_fetch_url(url, TRUE, NULL, TRUE, got_page_cb, gotdata); } @@ -2466,6 +2469,7 @@ regp[CHANNEL] = g_regex_new(P_CHANNEL, 0, 0, NULL); regp[IMAGE_IDENTICA] = g_regex_new(P_IMAGE_IDENTICA, 0, 0, NULL); regp[IMAGE_TWITTER] = g_regex_new(P_IMAGE_TWITTER, 0, 0, NULL); + regp[IMAGE_JISKO] = g_regex_new(P_IMAGE_JISKO, 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, @@ -2549,7 +2553,7 @@ plugin, PURPLE_CALLBACK(signed_on_cb)); /* unreference regp */ - for(i = 0; i < NUM_REGP; i++) { + for(i = 0; i < NUM_REGPS; i++) { g_regex_unref(regp[i]); } diff -r 3e459b078788 -r b436d72447e8 pidgin-twitter.h --- a/pidgin-twitter.h Sat Aug 09 12:20:29 2008 +0900 +++ b/pidgin-twitter.h Sat Aug 09 13:42:12 2008 +0900 @@ -35,7 +35,8 @@ USER_FORMATTED, CHANNEL, IMAGE_IDENTICA, - IMAGE_TWITTER + IMAGE_TWITTER, + IMAGE_JISKO }; /* service id */ @@ -145,6 +146,7 @@ #define P_CHANNEL "^(.*?[A-Za-z0-9_]+: \\r?\\n?#)([A-Za-z0-9_]+) " #define P_IMAGE_IDENTICA "\"[A-Za-z0-0_]+\"/" #define P_IMAGE_TWITTER "" +#define P_IMAGE_JISKO "\"Avatar\"" /* twitter API specific macros */ #define TWITTER_BASE_URL "http://twitter.com"