comparison src/protocols/oscar/oscar.c @ 6695:0c5637b5462e

[gaim-migrate @ 7221] This is contact support. Really. It has a few bugs left in it, like sorting not working, and stuff like that, but it's pretty solid for the most part. I'm not in the mood to do a whole lot of typing, so just use and enjoy. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Tue, 02 Sep 2003 03:41:10 +0000
parents 314111e7b601
children faa491042c66
comparison
equal deleted inserted replaced
6694:2d2f04c5c7d2 6695:0c5637b5462e
1830 bi->availmsg = NULL; 1830 bi->availmsg = NULL;
1831 1831
1832 /* Server stored icon stuff */ 1832 /* Server stored icon stuff */
1833 if (info->iconcsumlen) { 1833 if (info->iconcsumlen) {
1834 char *b16, *saved_b16; 1834 char *b16, *saved_b16;
1835 struct buddy *b; 1835 GaimBuddy *b;
1836 1836
1837 free(bi->iconcsum); 1837 free(bi->iconcsum);
1838 bi->iconcsum = malloc(info->iconcsumlen); 1838 bi->iconcsum = malloc(info->iconcsumlen);
1839 memcpy(bi->iconcsum, info->iconcsum, info->iconcsumlen); 1839 memcpy(bi->iconcsum, info->iconcsum, info->iconcsumlen);
1840 bi->iconcsumlen = info->iconcsumlen; 1840 bi->iconcsumlen = info->iconcsumlen;
2434 static void gaim_auth_request(struct name_data *data, char *msg) { 2434 static void gaim_auth_request(struct name_data *data, char *msg) {
2435 GaimConnection *gc = data->gc; 2435 GaimConnection *gc = data->gc;
2436 2436
2437 if (g_list_find(gaim_connections_get_all(), gc)) { 2437 if (g_list_find(gaim_connections_get_all(), gc)) {
2438 struct oscar_data *od = gc->proto_data; 2438 struct oscar_data *od = gc->proto_data;
2439 struct buddy *buddy = gaim_find_buddy(gc->account, data->name); 2439 GaimBuddy *buddy = gaim_find_buddy(gc->account, data->name);
2440 struct group *group = gaim_find_buddys_group(buddy); 2440 GaimGroup *group = gaim_find_buddys_group(buddy);
2441 if (buddy && group) { 2441 if (buddy && group) {
2442 gaim_debug(GAIM_DEBUG_INFO, "oscar", 2442 gaim_debug(GAIM_DEBUG_INFO, "oscar",
2443 "ssi: adding buddy %s to group %s\n", 2443 "ssi: adding buddy %s to group %s\n",
2444 buddy->name, group->name); 2444 buddy->name, group->name);
2445 aim_ssi_sendauthrequest(od->sess, data->name, msg ? msg : _("Please authorize me so I can add you to my buddy list.")); 2445 aim_ssi_sendauthrequest(od->sess, data->name, msg ? msg : _("Please authorize me so I can add you to my buddy list."));
2468 oscar_free_name_data(data); 2468 oscar_free_name_data(data);
2469 } 2469 }
2470 2470
2471 static void gaim_auth_sendrequest(GaimConnection *gc, const char *name) { 2471 static void gaim_auth_sendrequest(GaimConnection *gc, const char *name) {
2472 struct name_data *data = g_new(struct name_data, 1); 2472 struct name_data *data = g_new(struct name_data, 1);
2473 struct buddy *buddy; 2473 GaimBuddy *buddy;
2474 gchar *dialog_msg, *nombre; 2474 gchar *dialog_msg, *nombre;
2475 2475
2476 buddy = gaim_find_buddy(gc->account, name); 2476 buddy = gaim_find_buddy(gc->account, name);
2477 if (buddy && (gaim_get_buddy_alias_only(buddy))) 2477 if (buddy && (gaim_get_buddy_alias_only(buddy)))
2478 nombre = g_strdup_printf("%s (%s)", name, gaim_get_buddy_alias_only(buddy)); 2478 nombre = g_strdup_printf("%s (%s)", name, gaim_get_buddy_alias_only(buddy));
2499 GaimConnection *gc = data->gc; 2499 GaimConnection *gc = data->gc;
2500 2500
2501 if (g_list_find(gaim_connections_get_all(), gc)) { 2501 if (g_list_find(gaim_connections_get_all(), gc)) {
2502 struct oscar_data *od = gc->proto_data; 2502 struct oscar_data *od = gc->proto_data;
2503 #ifdef NOSSI 2503 #ifdef NOSSI
2504 struct buddy *buddy; 2504 GaimBuddy *buddy;
2505 gchar message; 2505 gchar message;
2506 message = 0; 2506 message = 0;
2507 buddy = gaim_find_buddy(gc->account, data->name); 2507 buddy = gaim_find_buddy(gc->account, data->name);
2508 aim_im_sendch4(od->sess, data->name, AIM_ICQMSG_AUTHGRANTED, &message); 2508 aim_im_sendch4(od->sess, data->name, AIM_ICQMSG_AUTHGRANTED, &message);
2509 show_got_added(gc, NULL, data->name, (buddy ? gaim_get_buddy_alias_only(buddy) : NULL), NULL); 2509 show_got_added(gc, NULL, data->name, (buddy ? gaim_get_buddy_alias_only(buddy) : NULL), NULL);
3509 iconlen = va_arg(ap, int); 3509 iconlen = va_arg(ap, int);
3510 va_end(ap); 3510 va_end(ap);
3511 3511
3512 if (iconlen > 0) { 3512 if (iconlen > 0) {
3513 char *b16; 3513 char *b16;
3514 struct buddy *b = gaim_find_buddy(gc->account, sn); 3514 GaimBuddy *b = gaim_find_buddy(gc->account, sn);
3515 set_icon_data(gc, sn, icon, iconlen); 3515 set_icon_data(gc, sn, icon, iconlen);
3516 b16 = tobase16(iconcsum, iconcsumlen); 3516 b16 = tobase16(iconcsum, iconcsumlen);
3517 if (b16) { 3517 if (b16) {
3518 gaim_buddy_set_setting(b, "icon_checksum", b16); 3518 gaim_buddy_set_setting(b, "icon_checksum", b16);
3519 gaim_blist_save(); 3519 gaim_blist_save();
4054 4054
4055 static int gaim_icqalias(aim_session_t *sess, aim_frame_t *fr, ...) 4055 static int gaim_icqalias(aim_session_t *sess, aim_frame_t *fr, ...)
4056 { 4056 {
4057 GaimConnection *gc = sess->aux_data; 4057 GaimConnection *gc = sess->aux_data;
4058 gchar who[16], *utf8; 4058 gchar who[16], *utf8;
4059 struct buddy *b; 4059 GaimBuddy *b;
4060 va_list ap; 4060 va_list ap;
4061 struct aim_icq_info *info; 4061 struct aim_icq_info *info;
4062 4062
4063 va_start(ap, fr); 4063 va_start(ap, fr);
4064 info = va_arg(ap, struct aim_icq_info *); 4064 info = va_arg(ap, struct aim_icq_info *);
4413 } 4413 }
4414 4414
4415 static void oscar_get_away(GaimConnection *g, const char *who) { 4415 static void oscar_get_away(GaimConnection *g, const char *who) {
4416 struct oscar_data *od = (struct oscar_data *)g->proto_data; 4416 struct oscar_data *od = (struct oscar_data *)g->proto_data;
4417 if (od->icq) { 4417 if (od->icq) {
4418 struct buddy *budlight = gaim_find_buddy(g->account, who); 4418 GaimBuddy *budlight = gaim_find_buddy(g->account, who);
4419 if (budlight) 4419 if (budlight)
4420 if ((budlight->uc & 0xffff0000) >> 16) 4420 if ((budlight->uc & 0xffff0000) >> 16)
4421 aim_im_sendch2_geticqaway(od->sess, who, (budlight->uc & 0xffff0000) >> 16); 4421 aim_im_sendch2_geticqaway(od->sess, who, (budlight->uc & 0xffff0000) >> 16);
4422 else 4422 else
4423 gaim_debug(GAIM_DEBUG_ERROR, "oscar", 4423 gaim_debug(GAIM_DEBUG_ERROR, "oscar",
4637 struct oscar_data *od = (struct oscar_data *)gc->proto_data; 4637 struct oscar_data *od = (struct oscar_data *)gc->proto_data;
4638 #ifdef NOSSI 4638 #ifdef NOSSI
4639 aim_add_buddy(od->sess, od->conn, name); 4639 aim_add_buddy(od->sess, od->conn, name);
4640 #else 4640 #else
4641 if ((od->sess->ssi.received_data) && !(aim_ssi_itemlist_exists(od->sess->ssi.local, name))) { 4641 if ((od->sess->ssi.received_data) && !(aim_ssi_itemlist_exists(od->sess->ssi.local, name))) {
4642 struct buddy *buddy = gaim_find_buddy(gc->account, name); 4642 GaimBuddy *buddy = gaim_find_buddy(gc->account, name);
4643 struct group *group = gaim_find_buddys_group(buddy); 4643 GaimGroup *group = gaim_find_buddys_group(buddy);
4644 if (buddy && group) { 4644 if (buddy && group) {
4645 gaim_debug(GAIM_DEBUG_INFO, "oscar", 4645 gaim_debug(GAIM_DEBUG_INFO, "oscar",
4646 "ssi: adding buddy %s to group %s\n", name, group->name); 4646 "ssi: adding buddy %s to group %s\n", name, group->name);
4647 aim_ssi_addbuddy(od->sess, buddy->name, group->name, gaim_get_buddy_alias_only(buddy), NULL, NULL, 0); 4647 aim_ssi_addbuddy(od->sess, buddy->name, group->name, gaim_get_buddy_alias_only(buddy), NULL, NULL, 0);
4648 } 4648 }
4667 } 4667 }
4668 aim_bos_setbuddylist(od->sess, od->conn, buf); 4668 aim_bos_setbuddylist(od->sess, od->conn, buf);
4669 #else 4669 #else
4670 if (od->sess->ssi.received_data) { 4670 if (od->sess->ssi.received_data) {
4671 while (buddies) { 4671 while (buddies) {
4672 struct buddy *buddy = gaim_find_buddy(gc->account, (const char *)buddies->data); 4672 GaimBuddy *buddy = gaim_find_buddy(gc->account, (const char *)buddies->data);
4673 struct group *group = gaim_find_buddys_group(buddy); 4673 GaimGroup *group = gaim_find_buddys_group(buddy);
4674 if (buddy && group) { 4674 if (buddy && group) {
4675 gaim_debug(GAIM_DEBUG_INFO, "oscar", 4675 gaim_debug(GAIM_DEBUG_INFO, "oscar",
4676 "ssi: adding buddy %s to group %s\n", (const char *)buddies->data, group->name); 4676 "ssi: adding buddy %s to group %s\n", (const char *)buddies->data, group->name);
4677 aim_ssi_addbuddy(od->sess, buddy->name, group->name, gaim_get_buddy_alias_only(buddy), NULL, NULL, 0); 4677 aim_ssi_addbuddy(od->sess, buddy->name, group->name, gaim_get_buddy_alias_only(buddy), NULL, NULL, 0);
4678 } 4678 }
4847 if (curitem->name) { 4847 if (curitem->name) {
4848 char *gname = aim_ssi_itemlist_findparentname(sess->ssi.local, curitem->name); 4848 char *gname = aim_ssi_itemlist_findparentname(sess->ssi.local, curitem->name);
4849 char *gname_utf8 = gaim_try_conv_to_utf8(gname); 4849 char *gname_utf8 = gaim_try_conv_to_utf8(gname);
4850 char *alias = aim_ssi_getalias(sess->ssi.local, gname, curitem->name); 4850 char *alias = aim_ssi_getalias(sess->ssi.local, gname, curitem->name);
4851 char *alias_utf8 = gaim_try_conv_to_utf8(alias); 4851 char *alias_utf8 = gaim_try_conv_to_utf8(alias);
4852 struct buddy *buddy = gaim_find_buddy(gc->account, curitem->name); 4852 GaimBuddy *buddy = gaim_find_buddy(gc->account, curitem->name);
4853 /* Should gname be freed here? -- elb */ 4853 /* Should gname be freed here? -- elb */
4854 /* Not with the current code, but that might be cleaner -- med */ 4854 /* Not with the current code, but that might be cleaner -- med */
4855 free(alias); 4855 free(alias);
4856 if (buddy) { 4856 if (buddy) {
4857 /* Get server stored alias */ 4857 /* Get server stored alias */
4858 if (alias_utf8) { 4858 if (alias_utf8) {
4859 g_free(buddy->alias); 4859 g_free(buddy->alias);
4860 buddy->alias = g_strdup(alias_utf8); 4860 buddy->alias = g_strdup(alias_utf8);
4861 } 4861 }
4862 } else { 4862 } else {
4863 struct group *g; 4863 GaimGroup *g;
4864 buddy = gaim_buddy_new(gc->account, curitem->name, alias_utf8); 4864 buddy = gaim_buddy_new(gc->account, curitem->name, alias_utf8);
4865 4865
4866 if (!(g = gaim_find_group(gname_utf8 ? gname_utf8 : _("Orphans")))) { 4866 if (!(g = gaim_find_group(gname_utf8 ? gname_utf8 : _("Orphans")))) {
4867 g = gaim_group_new(gname_utf8 ? gname_utf8 : _("Orphans")); 4867 g = gaim_group_new(gname_utf8 ? gname_utf8 : _("Orphans"));
4868 gaim_blist_add_group(g, NULL); 4868 gaim_blist_add_group(g, NULL);
4869 } 4869 }
4870 4870
4871 gaim_debug(GAIM_DEBUG_INFO, "oscar", 4871 gaim_debug(GAIM_DEBUG_INFO, "oscar",
4872 "ssi: adding buddy %s to group %s to local list\n", curitem->name, gname_utf8 ? gname_utf8 : _("Orphans")); 4872 "ssi: adding buddy %s to group %s to local list\n", curitem->name, gname_utf8 ? gname_utf8 : _("Orphans"));
4873 gaim_blist_add_buddy(buddy, g, NULL); 4873 gaim_blist_add_buddy(buddy, NULL, g, NULL);
4874 export = TRUE; 4874 export = TRUE;
4875 } 4875 }
4876 free(gname_utf8); 4876 free(gname_utf8);
4877 free(alias_utf8); 4877 free(alias_utf8);
4878 } 4878 }
4933 /* If changes were made, then flush buddy list to file */ 4933 /* If changes were made, then flush buddy list to file */
4934 if (export) 4934 if (export)
4935 gaim_blist_save(); 4935 gaim_blist_save();
4936 4936
4937 { /* Add from local list to server list */ 4937 { /* Add from local list to server list */
4938 GaimBlistNode *gnode, *bnode; 4938 GaimBlistNode *gnode, *cnode, *bnode;
4939 struct group *group; 4939 GaimGroup *group;
4940 struct buddy *buddy; 4940 GaimBuddy *buddy;
4941 struct gaim_buddy_list *blist; 4941 struct gaim_buddy_list *blist;
4942 GSList *cur; 4942 GSList *cur;
4943 4943
4944 /* Buddies */ 4944 /* Buddies */
4945 if ((blist = gaim_get_blist())) 4945 if ((blist = gaim_get_blist()))
4946 for (gnode = blist->root; gnode; gnode = gnode->next) { 4946 for (gnode = blist->root; gnode; gnode = gnode->next) {
4947 if(!GAIM_BLIST_NODE_IS_GROUP(gnode)) 4947 if(!GAIM_BLIST_NODE_IS_GROUP(gnode))
4948 continue; 4948 continue;
4949 group = (struct group *)gnode; 4949 group = (GaimGroup *)gnode;
4950 for (bnode = gnode->child; bnode; bnode = bnode->next) { 4950 for (cnode = gnode->child; cnode; cnode = cnode->next) {
4951 if(!GAIM_BLIST_NODE_IS_BUDDY(bnode)) 4951 if(!GAIM_BLIST_NODE_IS_CONTACT(cnode))
4952 continue; 4952 continue;
4953 buddy = (struct buddy *)bnode; 4953 for (bnode = cnode->child; bnode; bnode = bnode->next) {
4954 if (buddy->account == gc->account) { 4954 if(!GAIM_BLIST_NODE_IS_BUDDY(bnode))
4955 gchar *servernick = gaim_buddy_get_setting(buddy, "servernick"); 4955 continue;
4956 if (servernick) { 4956 buddy = (GaimBuddy *)bnode;
4957 serv_got_alias(gc, buddy->name, servernick); 4957 if (buddy->account == gc->account) {
4958 g_free(servernick); 4958 gchar *servernick = gaim_buddy_get_setting(buddy, "servernick");
4959 } 4959 if (servernick) {
4960 if (aim_ssi_itemlist_exists(sess->ssi.local, buddy->name)) { 4960 serv_got_alias(gc, buddy->name, servernick);
4961 /* Store local alias on server */ 4961 g_free(servernick);
4962 char *alias = aim_ssi_getalias(sess->ssi.local, group->name, buddy->name); 4962 }
4963 if (!alias && buddy->alias && strlen(buddy->alias)) 4963 if (aim_ssi_itemlist_exists(sess->ssi.local, buddy->name)) {
4964 aim_ssi_aliasbuddy(sess, group->name, buddy->name, buddy->alias); 4964 /* Store local alias on server */
4965 free(alias); 4965 char *alias = aim_ssi_getalias(sess->ssi.local, group->name, buddy->name);
4966 } else { 4966 if (!alias && buddy->alias && strlen(buddy->alias))
4967 gaim_debug(GAIM_DEBUG_INFO, "oscar", 4967 aim_ssi_aliasbuddy(sess, group->name, buddy->name, buddy->alias);
4968 "ssi: adding buddy %s from local list to server list\n", buddy->name); 4968 free(alias);
4969 aim_ssi_addbuddy(sess, buddy->name, group->name, gaim_get_buddy_alias_only(buddy), NULL, NULL, 0); 4969 } else {
4970 gaim_debug(GAIM_DEBUG_INFO, "oscar",
4971 "ssi: adding buddy %s from local list to server list\n", buddy->name);
4972 aim_ssi_addbuddy(sess, buddy->name, group->name, gaim_get_buddy_alias_only(buddy), NULL, NULL, 0);
4973 }
4970 } 4974 }
4971 } 4975 }
4972 } 4976 }
4973 } 4977 }
4978
4974 /* Permit list */ 4979 /* Permit list */
4975 if (gc->account->permit) { 4980 if (gc->account->permit) {
4976 for (cur=gc->account->permit; cur; cur=cur->next) 4981 for (cur=gc->account->permit; cur; cur=cur->next)
4977 if (!aim_ssi_itemlist_finditem(sess->ssi.local, NULL, cur->data, AIM_SSI_TYPE_PERMIT)) { 4982 if (!aim_ssi_itemlist_finditem(sess->ssi.local, NULL, cur->data, AIM_SSI_TYPE_PERMIT)) {
4978 gaim_debug(GAIM_DEBUG_INFO, "oscar", 4983 gaim_debug(GAIM_DEBUG_INFO, "oscar",
4979 "ssi: adding permit %s from local list to server list\n", (char *)cur->data); 4984 "ssi: adding permit %s from local list to server list\n", (char *)cur->data);
4980 aim_ssi_addpermit(sess, cur->data); 4985 aim_ssi_addpermit(sess, cur->data);
4981 } 4986 }
4982 } 4987 }
4983 4988
4984 /* Deny list */ 4989 /* Deny list */
4985 if (gc->account->deny) { 4990 if (gc->account->deny) {
4986 for (cur=gc->account->deny; cur; cur=cur->next) 4991 for (cur=gc->account->deny; cur; cur=cur->next)
4987 if (!aim_ssi_itemlist_finditem(sess->ssi.local, NULL, cur->data, AIM_SSI_TYPE_DENY)) { 4992 if (!aim_ssi_itemlist_finditem(sess->ssi.local, NULL, cur->data, AIM_SSI_TYPE_DENY)) {
4988 gaim_debug(GAIM_DEBUG_INFO, "oscar", 4993 gaim_debug(GAIM_DEBUG_INFO, "oscar",
4989 "ssi: adding deny %s from local list to server list\n", (char *)cur->data); 4994 "ssi: adding deny %s from local list to server list\n", (char *)cur->data);
4990 aim_ssi_adddeny(sess, cur->data); 4995 aim_ssi_adddeny(sess, cur->data);
4991 } 4996 }
4992 } 4997 }
4993 /* Presence settings (idle time visibility) */ 4998 /* Presence settings (idle time visibility) */
4994 if ((tmp = aim_ssi_getpresence(sess->ssi.local)) != 0xFFFFFFFF) 4999 if ((tmp = aim_ssi_getpresence(sess->ssi.local)) != 0xFFFFFFFF)
5061 GaimConnection *gc = sess->aux_data; 5066 GaimConnection *gc = sess->aux_data;
5062 va_list ap; 5067 va_list ap;
5063 char *sn, *msg; 5068 char *sn, *msg;
5064 gchar *dialog_msg, *nombre; 5069 gchar *dialog_msg, *nombre;
5065 struct name_data *data; 5070 struct name_data *data;
5066 struct buddy *buddy; 5071 GaimBuddy *buddy;
5067 5072
5068 va_start(ap, fr); 5073 va_start(ap, fr);
5069 sn = va_arg(ap, char *); 5074 sn = va_arg(ap, char *);
5070 msg = va_arg(ap, char *); 5075 msg = va_arg(ap, char *);
5071 va_end(ap); 5076 va_end(ap);
5100 GaimConnection *gc = sess->aux_data; 5105 GaimConnection *gc = sess->aux_data;
5101 va_list ap; 5106 va_list ap;
5102 char *sn, *msg; 5107 char *sn, *msg;
5103 gchar *dialog_msg, *nombre; 5108 gchar *dialog_msg, *nombre;
5104 struct name_data *data; 5109 struct name_data *data;
5105 struct buddy *buddy; 5110 GaimBuddy *buddy;
5106 5111
5107 va_start(ap, fr); 5112 va_start(ap, fr);
5108 sn = va_arg(ap, char *); 5113 sn = va_arg(ap, char *);
5109 msg = va_arg(ap, char *); 5114 msg = va_arg(ap, char *);
5110 va_end(ap); 5115 va_end(ap);
5139 GaimConnection *gc = sess->aux_data; 5144 GaimConnection *gc = sess->aux_data;
5140 va_list ap; 5145 va_list ap;
5141 char *sn, *msg; 5146 char *sn, *msg;
5142 gchar *dialog_msg, *nombre; 5147 gchar *dialog_msg, *nombre;
5143 fu8_t reply; 5148 fu8_t reply;
5144 struct buddy *buddy; 5149 GaimBuddy *buddy;
5145 5150
5146 va_start(ap, fr); 5151 va_start(ap, fr);
5147 sn = va_arg(ap, char *); 5152 sn = va_arg(ap, char *);
5148 reply = (fu8_t)va_arg(ap, int); 5153 reply = (fu8_t)va_arg(ap, int);
5149 msg = va_arg(ap, char *); 5154 msg = va_arg(ap, char *);
5175 5180
5176 static int gaim_ssi_gotadded(aim_session_t *sess, aim_frame_t *fr, ...) { 5181 static int gaim_ssi_gotadded(aim_session_t *sess, aim_frame_t *fr, ...) {
5177 GaimConnection *gc = sess->aux_data; 5182 GaimConnection *gc = sess->aux_data;
5178 va_list ap; 5183 va_list ap;
5179 char *sn; 5184 char *sn;
5180 struct buddy *buddy; 5185 GaimBuddy *buddy;
5181 5186
5182 va_start(ap, fr); 5187 va_start(ap, fr);
5183 sn = va_arg(ap, char *); 5188 sn = va_arg(ap, char *);
5184 va_end(ap); 5189 va_end(ap);
5185 5190
5342 aim_chat_send_im(od->sess, c->conn, 0, buf, strlen(buf)); 5347 aim_chat_send_im(od->sess, c->conn, 0, buf, strlen(buf));
5343 g_free(buf); 5348 g_free(buf);
5344 return 0; 5349 return 0;
5345 } 5350 }
5346 5351
5347 static const char *oscar_list_icon(GaimAccount *a, struct buddy *b) { 5352 static const char *oscar_list_icon(GaimAccount *a, GaimBuddy *b) {
5348 if (!b || (b && b->name && b->name[0] == '+')) { 5353 if (!b || (b && b->name && b->name[0] == '+')) {
5349 if (a != NULL && isdigit(*gaim_account_get_username(a))) 5354 if (a != NULL && isdigit(*gaim_account_get_username(a)))
5350 return "icq"; 5355 return "icq";
5351 else 5356 else
5352 return "aim"; 5357 return "aim";
5355 if (b != NULL && isdigit(b->name[0])) 5360 if (b != NULL && isdigit(b->name[0]))
5356 return "icq"; 5361 return "icq";
5357 return "aim"; 5362 return "aim";
5358 } 5363 }
5359 5364
5360 static void oscar_list_emblems(struct buddy *b, char **se, char **sw, char **nw, char **ne) 5365 static void oscar_list_emblems(GaimBuddy *b, char **se, char **sw, char **nw, char **ne)
5361 { 5366 {
5362 char *emblems[4] = {NULL,NULL,NULL,NULL}; 5367 char *emblems[4] = {NULL,NULL,NULL,NULL};
5363 int i = 0; 5368 int i = 0;
5364 5369
5365 if (!GAIM_BUDDY_IS_ONLINE(b)) { 5370 if (!GAIM_BUDDY_IS_ONLINE(b)) {
5411 *sw = emblems[1]; 5416 *sw = emblems[1];
5412 *nw = emblems[2]; 5417 *nw = emblems[2];
5413 *ne = emblems[3]; 5418 *ne = emblems[3];
5414 } 5419 }
5415 5420
5416 static char *oscar_tooltip_text(struct buddy *b) { 5421 static char *oscar_tooltip_text(GaimBuddy *b) {
5417 GaimConnection *gc = b->account->gc; 5422 GaimConnection *gc = b->account->gc;
5418 struct oscar_data *od = gc->proto_data; 5423 struct oscar_data *od = gc->proto_data;
5419 struct buddyinfo *bi = g_hash_table_lookup(od->buddyinfo, normalize(b->name)); 5424 struct buddyinfo *bi = g_hash_table_lookup(od->buddyinfo, normalize(b->name));
5420 gchar *tmp, *yay = g_strdup(""); 5425 gchar *tmp, *yay = g_strdup("");
5421 5426
5469 if (yay) 5474 if (yay)
5470 yay[strlen(yay)-1] = '\0'; 5475 yay[strlen(yay)-1] = '\0';
5471 return yay; 5476 return yay;
5472 } 5477 }
5473 5478
5474 static char *oscar_status_text(struct buddy *b) { 5479 static char *oscar_status_text(GaimBuddy *b) {
5475 GaimConnection *gc = b->account->gc; 5480 GaimConnection *gc = b->account->gc;
5476 struct oscar_data *od = gc->proto_data; 5481 struct oscar_data *od = gc->proto_data;
5477 gchar *ret = NULL; 5482 gchar *ret = NULL;
5478 5483
5479 if ((b->uc & UC_UNAVAILABLE) || (((b->uc & 0xffff0000) >> 16) & AIM_ICQ_STATE_CHAT)) { 5484 if ((b->uc & UC_UNAVAILABLE) || (((b->uc & 0xffff0000) >> 16) & AIM_ICQ_STATE_CHAT)) {
5894 pbm->callback = oscar_get_icqstatusmsg; 5899 pbm->callback = oscar_get_icqstatusmsg;
5895 pbm->gc = gc; 5900 pbm->gc = gc;
5896 m = g_list_append(m, pbm); 5901 m = g_list_append(m, pbm);
5897 #endif 5902 #endif
5898 } else { 5903 } else {
5899 struct buddy *b = gaim_find_buddy(gc->account, who); 5904 GaimBuddy *b = gaim_find_buddy(gc->account, who);
5900 struct buddyinfo *bi; 5905 struct buddyinfo *bi;
5901 5906
5902 if (b) 5907 if (b)
5903 bi = g_hash_table_lookup(od->buddyinfo, normalize(b->name)); 5908 bi = g_hash_table_lookup(od->buddyinfo, normalize(b->name));
5904 5909
6020 6025
6021 static void oscar_show_awaitingauth(GaimConnection *gc) 6026 static void oscar_show_awaitingauth(GaimConnection *gc)
6022 { 6027 {
6023 struct oscar_data *od = gc->proto_data; 6028 struct oscar_data *od = gc->proto_data;
6024 gchar *nombre, *text, *tmp; 6029 gchar *nombre, *text, *tmp;
6025 GaimBlistNode *gnode,*bnode; 6030 GaimBlistNode *gnode, *cnode, *bnode;
6026 int num=0; 6031 int num=0;
6027 6032
6028 text = g_strdup(_("You are awaiting authorization from the following buddies:<BR>")); 6033 text = g_strdup(_("You are awaiting authorization from the following buddies:<BR>"));
6029 6034
6030 for (gnode = gaim_get_blist()->root; gnode; gnode = gnode->next) { 6035 for (gnode = gaim_get_blist()->root; gnode; gnode = gnode->next) {
6031 struct group *group = (struct group *)gnode; 6036 GaimGroup *group = (GaimGroup *)gnode;
6032 if(!GAIM_BLIST_NODE_IS_GROUP(gnode)) 6037 if(!GAIM_BLIST_NODE_IS_GROUP(gnode))
6033 continue; 6038 continue;
6034 for (bnode = gnode->child; bnode; bnode = bnode->next) { 6039 for (cnode = gnode->child; cnode; cnode = cnode->next) {
6035 struct buddy *buddy = (struct buddy *)bnode; 6040 if(!GAIM_BLIST_NODE_IS_CONTACT(cnode))
6036 if(!GAIM_BLIST_NODE_IS_BUDDY(bnode))
6037 continue; 6041 continue;
6038 if (buddy->account == gc->account && aim_ssi_waitingforauth(od->sess->ssi.local, group->name, buddy->name)) { 6042 for (bnode = cnode->child; bnode; bnode = bnode->next) {
6039 if (gaim_get_buddy_alias_only(buddy)) 6043 GaimBuddy *buddy = (GaimBuddy *)bnode;
6040 nombre = g_strdup_printf(" %s (%s)", buddy->name, gaim_get_buddy_alias_only(buddy)); 6044 if(!GAIM_BLIST_NODE_IS_BUDDY(bnode))
6041 else 6045 continue;
6042 nombre = g_strdup_printf(" %s", buddy->name); 6046 if (buddy->account == gc->account && aim_ssi_waitingforauth(od->sess->ssi.local, group->name, buddy->name)) {
6043 tmp = g_strdup_printf("%s<BR>%s", text, nombre); 6047 if (gaim_get_buddy_alias_only(buddy))
6044 g_free(text); 6048 nombre = g_strdup_printf(" %s (%s)", buddy->name, gaim_get_buddy_alias_only(buddy));
6045 text = tmp; 6049 else
6046 g_free(nombre); 6050 nombre = g_strdup_printf(" %s", buddy->name);
6047 num++; 6051 tmp = g_strdup_printf("%s<BR>%s", text, nombre);
6052 g_free(text);
6053 text = tmp;
6054 g_free(nombre);
6055 num++;
6056 }
6048 } 6057 }
6049 } 6058 }
6050 } 6059 }
6051 6060
6052 if (!num) { 6061 if (!num) {