comparison src/protocols/oscar/oscar.c @ 7693:1d0314b99747

[gaim-migrate @ 8338] this doesn't seem to crash, so I figured I'd put it in get rid of the gaim_{buddy,chat,group}_{get,set}_setting() functions and replace them with gaim_blist_node_{get,set}_{bool,int,string} so we can have types, and clean up the code, all at the same time. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Tue, 02 Dec 2003 07:08:02 +0000
parents 8a826b27fcfb
children 2176fef95d9b
comparison
equal deleted inserted replaced
7692:8a826b27fcfb 7693:1d0314b99747
1832 b = gaim_find_buddy(gc->account, info->sn); 1832 b = gaim_find_buddy(gc->account, info->sn);
1833 /* 1833 /*
1834 * If for some reason the checksum is valid, but cached file is not.. 1834 * If for some reason the checksum is valid, but cached file is not..
1835 * we want to know. 1835 * we want to know.
1836 */ 1836 */
1837 filename = gaim_buddy_get_setting(b, "buddy_icon"); 1837 filename = gaim_blist_node_get_string((GaimBlistNode*)b, "buddy_icon");
1838 if (filename != NULL) { 1838 if (filename != NULL) {
1839 if (g_file_test(filename, G_FILE_TEST_EXISTS)) 1839 if (g_file_test(filename, G_FILE_TEST_EXISTS))
1840 saved_b16 = gaim_buddy_get_setting(b, "icon_checksum"); 1840 saved_b16 = gaim_blist_node_get_string((GaimBlistNode*)b,
1841 "icon_checksum");
1841 } else 1842 } else
1842 saved_b16 = NULL; 1843 saved_b16 = NULL;
1843 1844
1844 if (!b16 || !saved_b16 || strcmp(b16, saved_b16)) { 1845 if (!b16 || !saved_b16 || strcmp(b16, saved_b16)) {
1845 GSList *cur = od->requesticon; 1846 GSList *cur = od->requesticon;
3466 GaimBuddy *b = gaim_find_buddy(gc->account, sn); 3467 GaimBuddy *b = gaim_find_buddy(gc->account, sn);
3467 gaim_buddy_icons_set_for_user(gaim_connection_get_account(gc), 3468 gaim_buddy_icons_set_for_user(gaim_connection_get_account(gc),
3468 sn, icon, iconlen); 3469 sn, icon, iconlen);
3469 b16 = gaim_base16_encode(iconcsum, iconcsumlen); 3470 b16 = gaim_base16_encode(iconcsum, iconcsumlen);
3470 if (b16) { 3471 if (b16) {
3471 gaim_buddy_set_setting(b, "icon_checksum", b16); 3472 gaim_blist_node_set_string((GaimBlistNode*)b, "icon_checksum", b16);
3472 gaim_blist_save(); 3473 gaim_blist_save();
3473 g_free(b16); 3474 g_free(b16);
3474 } 3475 }
3475 } 3476 }
3476 3477
4074 4075
4075 if (info->uin && info->nick && info->nick[0] && (utf8 = gaim_utf8_try_convert(info->nick))) { 4076 if (info->uin && info->nick && info->nick[0] && (utf8 = gaim_utf8_try_convert(info->nick))) {
4076 g_snprintf(who, sizeof(who), "%u", info->uin); 4077 g_snprintf(who, sizeof(who), "%u", info->uin);
4077 serv_got_alias(gc, who, utf8); 4078 serv_got_alias(gc, who, utf8);
4078 if ((b = gaim_find_buddy(gc->account, who))) { 4079 if ((b = gaim_find_buddy(gc->account, who))) {
4079 gaim_buddy_set_setting(b, "servernick", utf8); 4080 gaim_blist_node_set_string((GaimBlistNode*)b, "servernick", utf8);
4080 gaim_blist_save(); 4081 gaim_blist_save();
4081 } 4082 }
4082 g_free(utf8); 4083 g_free(utf8);
4083 } 4084 }
4084 4085
4957 for (bnode = cnode->child; bnode; bnode = bnode->next) { 4958 for (bnode = cnode->child; bnode; bnode = bnode->next) {
4958 if(!GAIM_BLIST_NODE_IS_BUDDY(bnode)) 4959 if(!GAIM_BLIST_NODE_IS_BUDDY(bnode))
4959 continue; 4960 continue;
4960 buddy = (GaimBuddy *)bnode; 4961 buddy = (GaimBuddy *)bnode;
4961 if (buddy->account == gc->account) { 4962 if (buddy->account == gc->account) {
4962 const char *servernick = gaim_buddy_get_setting(buddy, "servernick"); 4963 const char *servernick = gaim_blist_node_get_string((GaimBlistNode*)buddy, "servernick");
4963 if (servernick) 4964 if (servernick)
4964 serv_got_alias(gc, buddy->name, servernick); 4965 serv_got_alias(gc, buddy->name, servernick);
4965 4966
4966 if (aim_ssi_itemlist_exists(sess->ssi.local, buddy->name)) { 4967 if (aim_ssi_itemlist_exists(sess->ssi.local, buddy->name)) {
4967 /* Store local alias on server */ 4968 /* Store local alias on server */