Mercurial > pidgin-twitter
comparison icon.c @ 259:d45dd3589560
little clean up
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Wed, 03 Dec 2008 01:18:19 +0900 |
parents | 2145f975ef69 |
children | e9a7c018a952 |
comparison
equal
deleted
inserted
replaced
258:2145f975ef69 | 259:d45dd3589560 |
---|---|
1 #include "pidgin-twitter.h" | 1 #include "pidgin-twitter.h" |
2 #include "icon.h" | |
3 | 2 |
4 extern GHashTable *icon_hash[]; | 3 extern GHashTable *icon_hash[]; |
5 extern GRegex *regp[]; | 4 extern GRegex *regp[]; |
6 | 5 |
7 /* prototypes */ | 6 /* prototypes */ |
388 if(data) { | 387 if(data) { |
389 /* remove download request */ | 388 /* remove download request */ |
390 data->requested = FALSE; | 389 data->requested = FALSE; |
391 data->fetch_data = NULL; | 390 data->fetch_data = NULL; |
392 | 391 |
393 /* return if user's icon had been downloaded */ | 392 /* return if user's icon has been downloaded */ |
394 if(data->pixbuf) { | 393 if(data->pixbuf) { |
395 twitter_debug("%s's icon has already been downloaded\n", | 394 twitter_debug("%s's icon has already been downloaded\n", |
396 user_name); | 395 user_name); |
397 | 396 |
398 goto fin_got_icon_cb; | 397 goto fin_got_icon_cb; |
472 } | 471 } |
473 | 472 |
474 twitter_debug("Downloading %s's icon has been complete.\n", | 473 twitter_debug("Downloading %s's icon has been complete.\n", |
475 user_name); | 474 user_name); |
476 | 475 |
477 /* Insert the icon to messages that had been received. */ | 476 /* Insert the icon to messages that has been received. */ |
478 insert_requested_icon(user_name, service); | 477 insert_requested_icon(user_name, service); |
479 | 478 |
480 fin_got_icon_cb: | 479 fin_got_icon_cb: |
481 g_free(gotdata->user_name); | 480 g_free(gotdata->user_name); |
482 g_free(gotdata); | 481 g_free(gotdata); |
501 case wassr_service: | 500 case wassr_service: |
502 hash = icon_hash[wassr_service]; | 501 hash = icon_hash[wassr_service]; |
503 suffix = "wassr"; | 502 suffix = "wassr"; |
504 break; | 503 break; |
505 case identica_service: | 504 case identica_service: |
505 hash = icon_hash[identica_service]; | |
506 suffix = "identica"; | 506 suffix = "identica"; |
507 hash = icon_hash[identica_service]; | |
508 break; | 507 break; |
509 case jisko_service: | 508 case jisko_service: |
509 hash = icon_hash[jisko_service]; | |
510 suffix = "jisko"; | 510 suffix = "jisko"; |
511 hash = icon_hash[jisko_service]; | |
512 break; | 511 break; |
513 default: | 512 default: |
514 twitter_debug("unknown service\n"); | 513 twitter_debug("unknown service\n"); |
515 break; | 514 break; |
516 } | 515 } |
520 | 519 |
521 /* since this function is called after mark_icon_for_user(), data | 520 /* since this function is called after mark_icon_for_user(), data |
522 * must exist here. */ | 521 * must exist here. */ |
523 data = (icon_data *)g_hash_table_lookup(hash, user_name); | 522 data = (icon_data *)g_hash_table_lookup(hash, user_name); |
524 | 523 |
525 /* if img has been registerd, just return */ | 524 /* if the image is in a hash, just return */ |
526 if(data && data->pixbuf && !renew) | 525 if(data && data->pixbuf && !renew) |
527 return; | 526 return; |
528 | 527 |
529 /* check if saved file exists */ | 528 /* check if saved file exists */ |
530 if(suffix && !renew) { | 529 if(suffix && !renew) { |