Mercurial > pidgin-twitter
diff pidgin-twitter.c @ 160:aef26b56a54b
now it falls back to twitter default icon if the user has not set custom icon.
author | Yoshiki Yazawa <yaz@honeyplnaet.jp> |
---|---|
date | Sat, 26 Jul 2008 13:23:27 +0900 |
parents | b771ddf0b683 |
children | 5dcd8699cba0 |
line wrap: on
line diff
--- a/pidgin-twitter.c Sat Jul 26 04:47:47 2008 +0900 +++ b/pidgin-twitter.c Sat Jul 26 13:23:27 2008 +0900 @@ -1733,22 +1733,30 @@ return; } - /* setup image url */ + /* setup image url */ /* xxx need simplify --yaz */ g_regex_match(regp[regp_id], url_text, 0, &match_info); if(!g_match_info_matches(match_info)) { - twitter_debug("no image url found\n"); - g_match_info_free(match_info); - if(data) { - data->requested = FALSE; - data->fetch_data = NULL; + + if(service == twitter_service) { + twitter_debug("fall back to twitter default icon\n"); + url = g_strdup(TWITTER_DEFAULT_ICON_URL); } - g_free(gotdata->user_name); - g_free(gotdata); - return; + else { + twitter_debug("no image url found\n"); + if(data) { + data->requested = FALSE; + data->fetch_data = NULL; + } + g_free(gotdata->user_name); + g_free(gotdata); + return; + } } - url = g_match_info_fetch(match_info, 1); - g_match_info_free(match_info); + else { + url = g_match_info_fetch(match_info, 1); + g_match_info_free(match_info); + } gchar *slash = strrchr(url, '/'); *slash = '\0'; @@ -1770,7 +1778,7 @@ g_free(url); url = tmp; - twitter_debug("requested_url=%s\n", url); + twitter_debug("requested url=%s\n", url); /* request fetch image */ if(url) {