changeset 142:b573b534f32d

modified the way of encoding icon url.
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Wed, 23 Jul 2008 15:41:59 +0900
parents fc1bf6b9b540
children 71c027f4f95d
files pidgin-twitter.c
diffstat 1 files changed, 11 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin-twitter.c	Wed Jul 23 15:14:38 2008 +0900
+++ b/pidgin-twitter.c	Wed Jul 23 15:41:59 2008 +0900
@@ -1729,18 +1729,24 @@
     url = g_match_info_fetch(match_info, 1);
     g_match_info_free(match_info);
 
-    const char *encoded_url;
-    encoded_url = purple_url_encode(url);
-    g_free(url); url = NULL;
+    gchar *slash = strrchr(url, '/');
+    *slash = '\0';
+    gchar *tmp = g_strdup_printf("%s/%s", url,
+                                 purple_url_encode(slash+1));
+    g_free(url);
+    url = tmp;
+
+    twitter_debug("requested_url=%s\n", url);
 
     /* request fetch image */
-    if(encoded_url[0]) {
+    if(url) {
         /* reuse gotdata. just pass given one */
         /* gotdata will be released in got_icon_cb */
-        data->fetch_data = purple_util_fetch_url(encoded_url,
+        data->fetch_data = purple_util_fetch_url(url,
                                                  TRUE, NULL, TRUE,
                                                  got_icon_cb, gotdata);
         twitter_debug("request %s's icon\n", user_name);
+        g_free(url);
     }
 }