Mercurial > pidgin.yaz
comparison src/protocols/yahoo/yahoo.c @ 4349:0c68d402f59f
[gaim-migrate @ 4614]
XML Blist
Gaim stores all the buddy lists in one big happy file now. You can order
the buddies however you want, and they'll stay ordered that way.
We can also store some per-buddy information now, which will be cool.
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Sun, 19 Jan 2003 22:16:52 +0000 |
parents | cc2f780c0505 |
children | 2afc0f845e74 |
comparison
equal
deleted
inserted
replaced
4348:922b66840a51 | 4349:0c68d402f59f |
---|---|
462 l = l->next; | 462 l = l->next; |
463 | 463 |
464 if (pair->key != 87) | 464 if (pair->key != 87) |
465 continue; | 465 continue; |
466 | 466 |
467 do_import(gc, NULL); | |
468 lines = g_strsplit(pair->value, "\n", -1); | 467 lines = g_strsplit(pair->value, "\n", -1); |
469 for (tmp = lines; *tmp; tmp++) { | 468 for (tmp = lines; *tmp; tmp++) { |
470 split = g_strsplit(*tmp, ":", 2); | 469 split = g_strsplit(*tmp, ":", 2); |
471 if (!split) | 470 if (!split) |
472 continue; | 471 continue; |
474 g_strfreev(split); | 473 g_strfreev(split); |
475 continue; | 474 continue; |
476 } | 475 } |
477 buddies = g_strsplit(split[1], ",", -1); | 476 buddies = g_strsplit(split[1], ",", -1); |
478 for (bud = buddies; bud && *bud; bud++) | 477 for (bud = buddies; bud && *bud; bud++) |
479 if (!find_buddy(gc, *bud)) { | 478 if (!find_buddy(gc->user, *bud)) { |
480 add_buddy(gc, split[0], *bud, *bud); | 479 add_buddy(gc->user, split[0], *bud, *bud); |
481 export = TRUE; | 480 export = TRUE; |
482 } | 481 } |
483 g_strfreev(buddies); | 482 g_strfreev(buddies); |
484 g_strfreev(split); | 483 g_strfreev(split); |
485 } | 484 } |
486 g_strfreev(lines); | 485 g_strfreev(lines); |
487 } | 486 } |
488 | 487 |
489 if (export) | 488 if (export) |
490 do_export(gc); | 489 gaim_blist_save(); |
491 } | 490 } |
492 | 491 |
493 static void yahoo_process_notify(struct gaim_connection *gc, struct yahoo_packet *pkt) | 492 static void yahoo_process_notify(struct gaim_connection *gc, struct yahoo_packet *pkt) |
494 { | 493 { |
495 char *msg = NULL; | 494 char *msg = NULL; |
518 if (*stat == '1') | 517 if (*stat == '1') |
519 serv_got_typing(gc, from, 0, TYPING); | 518 serv_got_typing(gc, from, 0, TYPING); |
520 else | 519 else |
521 serv_got_typing_stopped(gc, from); | 520 serv_got_typing_stopped(gc, from); |
522 } else if (!g_strncasecmp(msg, "GAME", strlen("GAME"))) { | 521 } else if (!g_strncasecmp(msg, "GAME", strlen("GAME"))) { |
523 struct buddy *bud = find_buddy(gc, from); | 522 struct buddy *bud = find_buddy(gc->user, from); |
524 void *free1=NULL, *free2=NULL; | 523 void *free1=NULL, *free2=NULL; |
525 if (!bud) | 524 if (!bud) |
526 debug_printf("%s is playing a game, and doesn't want you to know.\n", from); | 525 debug_printf("%s is playing a game, and doesn't want you to know.\n", from); |
527 if (*stat == '1') { | 526 if (*stat == '1') { |
528 if (g_hash_table_lookup_extended (yd->games, from, free1, free2)) { | 527 if (g_hash_table_lookup_extended (yd->games, from, free1, free2)) { |
1068 static GList *yahoo_buddy_menu(struct gaim_connection *gc, char *who) | 1067 static GList *yahoo_buddy_menu(struct gaim_connection *gc, char *who) |
1069 { | 1068 { |
1070 GList *m = NULL; | 1069 GList *m = NULL; |
1071 struct proto_buddy_menu *pbm; | 1070 struct proto_buddy_menu *pbm; |
1072 struct yahoo_data *yd = (struct yahoo_data *)gc->proto_data; | 1071 struct yahoo_data *yd = (struct yahoo_data *)gc->proto_data; |
1073 struct buddy *b = find_buddy(gc, who); /* this should never be null. if it is, | 1072 struct buddy *b = find_buddy(gc->user, who); /* this should never be null. if it is, |
1074 segfault and get the bug report. */ | 1073 segfault and get the bug report. */ |
1075 static char buf[1024]; | 1074 static char buf[1024]; |
1076 static char buf2[1024]; | 1075 static char buf2[1024]; |
1077 | 1076 |
1078 if (b->uc & UC_UNAVAILABLE && b->uc >> 2 != YAHOO_STATUS_IDLE) { | 1077 if (b->uc & UC_UNAVAILABLE && b->uc >> 2 != YAHOO_STATUS_IDLE) { |
1310 char *group = NULL; | 1309 char *group = NULL; |
1311 | 1310 |
1312 if (!yd->logged_in) | 1311 if (!yd->logged_in) |
1313 return; | 1312 return; |
1314 | 1313 |
1315 g = find_group_by_buddy(gc, who); | 1314 g = find_group_by_buddy(find_buddy(gc->user, who)); |
1316 if (g) | 1315 if (g) |
1317 group = g->name; | 1316 group = g->name; |
1318 else | 1317 else |
1319 group = "Buddies"; | 1318 group = "Buddies"; |
1320 | 1319 |