comparison libpurple/protocols/yahoo/libymsg.c @ 30846:7c871249318b

Fix some "Dead nested assignment"s and then kill off some useless variables related to them.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sat, 14 Aug 2010 05:17:38 +0000
parents 06d8de5dd53c
children 351d07aefb09
comparison
equal deleted inserted replaced
30845:41906308232b 30846:7c871249318b
500 GHashTable *ht; 500 GHashTable *ht;
501 char *norm_bud = NULL; 501 char *norm_bud = NULL;
502 char *temp = NULL; 502 char *temp = NULL;
503 YahooFriend *f = NULL; /* It's your friends. They're going to want you to share your StarBursts. */ 503 YahooFriend *f = NULL; /* It's your friends. They're going to want you to share your StarBursts. */
504 /* But what if you had no friends? */ 504 /* But what if you had no friends? */
505 PurpleBuddy *b;
506 PurpleGroup *g;
507 YahooFederation fed = YAHOO_FEDERATION_NONE; 505 YahooFederation fed = YAHOO_FEDERATION_NONE;
508 int stealth = 0; 506 int stealth = 0;
509 507
510 ht = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_slist_free); 508 ht = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_slist_free);
511 509
547 break; 545 break;
548 } 546 }
549 if (yd->current_list15_grp) { 547 if (yd->current_list15_grp) {
550 /* This buddy is in a group */ 548 /* This buddy is in a group */
551 f = yahoo_friend_find_or_new(gc, norm_bud); 549 f = yahoo_friend_find_or_new(gc, norm_bud);
552 if (!(b = purple_find_buddy(account, norm_bud))) { 550 if (!purple_find_buddy(account, norm_bud)) {
551 PurpleBuddy *b;
552 PurpleGroup *g;
553 if (!(g = purple_find_group(yd->current_list15_grp))) { 553 if (!(g = purple_find_group(yd->current_list15_grp))) {
554 g = purple_group_new(yd->current_list15_grp); 554 g = purple_group_new(yd->current_list15_grp);
555 purple_blist_add_group(g, NULL); 555 purple_blist_add_group(g, NULL);
556 } 556 }
557 b = purple_buddy_new(account, norm_bud, NULL); 557 b = purple_buddy_new(account, norm_bud, NULL);
634 static void yahoo_process_list(PurpleConnection *gc, struct yahoo_packet *pkt) 634 static void yahoo_process_list(PurpleConnection *gc, struct yahoo_packet *pkt)
635 { 635 {
636 GSList *l = pkt->hash; 636 GSList *l = pkt->hash;
637 gboolean export = FALSE; 637 gboolean export = FALSE;
638 gboolean got_serv_list = FALSE; 638 gboolean got_serv_list = FALSE;
639 PurpleBuddy *b;
640 PurpleGroup *g;
641 YahooFriend *f = NULL; 639 YahooFriend *f = NULL;
642 PurpleAccount *account = purple_connection_get_account(gc); 640 PurpleAccount *account = purple_connection_get_account(gc);
643 YahooData *yd = gc->proto_data; 641 YahooData *yd = gc->proto_data;
644 GHashTable *ht; 642 GHashTable *ht;
645 643
703 buddies = g_strsplit(split[1], ",", -1); 701 buddies = g_strsplit(split[1], ",", -1);
704 for (bud = buddies; bud && *bud; bud++) { 702 for (bud = buddies; bud && *bud; bud++) {
705 norm_bud = g_strdup(purple_normalize(account, *bud)); 703 norm_bud = g_strdup(purple_normalize(account, *bud));
706 f = yahoo_friend_find_or_new(gc, norm_bud); 704 f = yahoo_friend_find_or_new(gc, norm_bud);
707 705
708 if (!(b = purple_find_buddy(account, norm_bud))) { 706 if (!purple_find_buddy(account, norm_bud)) {
707 PurpleBuddy *b;
708 PurpleGroup *g;
709 if (!(g = purple_find_group(grp))) { 709 if (!(g = purple_find_group(grp))) {
710 g = purple_group_new(grp); 710 g = purple_group_new(grp);
711 purple_blist_add_group(g, NULL); 711 purple_blist_add_group(g, NULL);
712 } 712 }
713 b = purple_buddy_new(account, norm_bud, NULL); 713 b = purple_buddy_new(account, norm_bud, NULL);
3804 3804
3805 const char *yahoo_list_emblem(PurpleBuddy *b) 3805 const char *yahoo_list_emblem(PurpleBuddy *b)
3806 { 3806 {
3807 PurpleAccount *account; 3807 PurpleAccount *account;
3808 PurpleConnection *gc; 3808 PurpleConnection *gc;
3809 YahooData *yd;
3810 YahooFriend *f; 3809 YahooFriend *f;
3811 PurplePresence *presence; 3810 PurplePresence *presence;
3812 3811
3813 if (!b || !(account = purple_buddy_get_account(b)) || 3812 if (!b || !(account = purple_buddy_get_account(b)) ||
3814 !(gc = purple_account_get_connection(account)) || 3813 !(gc = purple_account_get_connection(account)) ||
3815 !(yd = gc->proto_data)) 3814 !gc->proto_data)
3816 return NULL; 3815 return NULL;
3817 3816
3818 f = yahoo_friend_find(gc, purple_buddy_get_name(b)); 3817 f = yahoo_friend_find(gc, purple_buddy_get_name(b));
3819 if (!f) { 3818 if (!f) {
3820 return "not-authorized"; 3819 return "not-authorized";