comparison src/protocols/yahoo/yahoo.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 306790891ce7
children 7b878ee8f064
comparison
equal deleted inserted replaced
6694:2d2f04c5c7d2 6695:0c5637b5462e
464 464
465 static void yahoo_process_list(GaimConnection *gc, struct yahoo_packet *pkt) 465 static void yahoo_process_list(GaimConnection *gc, struct yahoo_packet *pkt)
466 { 466 {
467 GSList *l = pkt->hash; 467 GSList *l = pkt->hash;
468 gboolean export = FALSE; 468 gboolean export = FALSE;
469 struct buddy *b; 469 GaimBuddy *b;
470 struct group *g; 470 GaimGroup *g;
471 471
472 while (l) { 472 while (l) {
473 char **lines; 473 char **lines;
474 char **split; 474 char **split;
475 char **buddies; 475 char **buddies;
496 if (!(g = gaim_find_group(split[0]))) { 496 if (!(g = gaim_find_group(split[0]))) {
497 g = gaim_group_new(split[0]); 497 g = gaim_group_new(split[0]);
498 gaim_blist_add_group(g, NULL); 498 gaim_blist_add_group(g, NULL);
499 } 499 }
500 b = gaim_buddy_new(gc->account, *bud, NULL); 500 b = gaim_buddy_new(gc->account, *bud, NULL);
501 gaim_blist_add_buddy(b, g, NULL); 501 gaim_blist_add_buddy(b, NULL, g, NULL);
502 export = TRUE; 502 export = TRUE;
503 } 503 }
504 g_strfreev(buddies); 504 g_strfreev(buddies);
505 g_strfreev(split); 505 g_strfreev(split);
506 } 506 }
539 if (*stat == '1') 539 if (*stat == '1')
540 serv_got_typing(gc, from, 0, GAIM_TYPING); 540 serv_got_typing(gc, from, 0, GAIM_TYPING);
541 else 541 else
542 serv_got_typing_stopped(gc, from); 542 serv_got_typing_stopped(gc, from);
543 } else if (!g_ascii_strncasecmp(msg, "GAME", strlen("GAME"))) { 543 } else if (!g_ascii_strncasecmp(msg, "GAME", strlen("GAME"))) {
544 struct buddy *bud = gaim_find_buddy(gc->account, from); 544 GaimBuddy *bud = gaim_find_buddy(gc->account, from);
545 void *free1=NULL, *free2=NULL; 545 void *free1=NULL, *free2=NULL;
546 if (!bud) { 546 if (!bud) {
547 gaim_debug(GAIM_DEBUG_WARNING, "yahoo", 547 gaim_debug(GAIM_DEBUG_WARNING, "yahoo",
548 "%s is playing a game, and doesn't want " 548 "%s is playing a game, and doesn't want "
549 "you to know.\n", from); 549 "you to know.\n", from);
1062 if (gc->inpa) 1062 if (gc->inpa)
1063 gaim_input_remove(gc->inpa); 1063 gaim_input_remove(gc->inpa);
1064 g_free(yd); 1064 g_free(yd);
1065 } 1065 }
1066 1066
1067 static const char *yahoo_list_icon(GaimAccount *a, struct buddy *b) 1067 static const char *yahoo_list_icon(GaimAccount *a, GaimBuddy *b)
1068 { 1068 {
1069 return "yahoo"; 1069 return "yahoo";
1070 } 1070 }
1071 1071
1072 static void yahoo_list_emblems(struct buddy *b, char **se, char **sw, char **nw, char **ne) 1072 static void yahoo_list_emblems(GaimBuddy *b, char **se, char **sw, char **nw, char **ne)
1073 { 1073 {
1074 int i = 0; 1074 int i = 0;
1075 char *emblems[4] = {NULL,NULL,NULL,NULL}; 1075 char *emblems[4] = {NULL,NULL,NULL,NULL};
1076 if (b->present == GAIM_BUDDY_OFFLINE) { 1076 if (b->present == GAIM_BUDDY_OFFLINE) {
1077 *se = "offline"; 1077 *se = "offline";
1133 g_snprintf(url, sizeof url, "http://games.yahoo.com/games/%s", game); 1133 g_snprintf(url, sizeof url, "http://games.yahoo.com/games/%s", game);
1134 gaim_notify_uri(gc, url); 1134 gaim_notify_uri(gc, url);
1135 g_free(game); 1135 g_free(game);
1136 } 1136 }
1137 1137
1138 static char *yahoo_status_text(struct buddy *b) 1138 static char *yahoo_status_text(GaimBuddy *b)
1139 { 1139 {
1140 struct yahoo_data *yd = (struct yahoo_data*)b->account->gc->proto_data; 1140 struct yahoo_data *yd = (struct yahoo_data*)b->account->gc->proto_data;
1141 1141
1142 if ((b->uc & UC_UNAVAILABLE) && ((b->uc >> 2) != YAHOO_STATUS_CUSTOM) 1142 if ((b->uc & UC_UNAVAILABLE) && ((b->uc >> 2) != YAHOO_STATUS_CUSTOM)
1143 && ((b->uc >> 2) != YAHOO_STATUS_IDLE)) 1143 && ((b->uc >> 2) != YAHOO_STATUS_IDLE))
1151 } 1151 }
1152 } 1152 }
1153 return NULL; 1153 return NULL;
1154 } 1154 }
1155 1155
1156 static char *yahoo_tooltip_text(struct buddy *b) 1156 static char *yahoo_tooltip_text(GaimBuddy *b)
1157 { 1157 {
1158 struct yahoo_data *yd = (struct yahoo_data*)b->account->gc->proto_data; 1158 struct yahoo_data *yd = (struct yahoo_data*)b->account->gc->proto_data;
1159 if ((b->uc & UC_UNAVAILABLE) || ((b->uc >> 2) == YAHOO_STATUS_CUSTOM)) { 1159 if ((b->uc & UC_UNAVAILABLE) || ((b->uc >> 2) == YAHOO_STATUS_CUSTOM)) {
1160 char *status; 1160 char *status;
1161 char *ret; 1161 char *ret;
1177 static GList *yahoo_buddy_menu(GaimConnection *gc, const char *who) 1177 static GList *yahoo_buddy_menu(GaimConnection *gc, const char *who)
1178 { 1178 {
1179 GList *m = NULL; 1179 GList *m = NULL;
1180 struct proto_buddy_menu *pbm; 1180 struct proto_buddy_menu *pbm;
1181 struct yahoo_data *yd = (struct yahoo_data *)gc->proto_data; 1181 struct yahoo_data *yd = (struct yahoo_data *)gc->proto_data;
1182 struct buddy *b = gaim_find_buddy(gc->account, who); /* this should never be null. if it is, 1182 GaimBuddy *b = gaim_find_buddy(gc->account, who); /* this should never be null. if it is,
1183 segfault and get the bug report. */ 1183 segfault and get the bug report. */
1184 static char buf2[1024]; 1184 static char buf2[1024];
1185 1185
1186 if (b->uc | YAHOO_STATUS_GAME) { 1186 if (b->uc | YAHOO_STATUS_GAME) {
1187 char *game = g_hash_table_lookup(yd->games, b->name); 1187 char *game = g_hash_table_lookup(yd->games, b->name);
1405 1405
1406 static void yahoo_add_buddy(GaimConnection *gc, const char *who) 1406 static void yahoo_add_buddy(GaimConnection *gc, const char *who)
1407 { 1407 {
1408 struct yahoo_data *yd = (struct yahoo_data *)gc->proto_data; 1408 struct yahoo_data *yd = (struct yahoo_data *)gc->proto_data;
1409 struct yahoo_packet *pkt; 1409 struct yahoo_packet *pkt;
1410 struct group *g; 1410 GaimGroup *g;
1411 char *group = NULL; 1411 char *group = NULL;
1412 1412
1413 if (!yd->logged_in) 1413 if (!yd->logged_in)
1414 return; 1414 return;
1415 1415