comparison src/protocols/zephyr/zephyr.c @ 4785:1e28e7d802a1

[gaim-migrate @ 5105] fix a few things, get rid of a few stale functions, and get rid of the compatibility functions. wee! committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sat, 15 Mar 2003 03:23:30 +0000
parents 92ae181271e9
children 677d3cb193a1
comparison
equal deleted inserted replaced
4784:b1365291f002 4785:1e28e7d802a1
438 return TRUE; 438 return TRUE;
439 } 439 }
440 440
441 static gint check_loc(gpointer data) 441 static gint check_loc(gpointer data)
442 { 442 {
443 GSList *gr, *gr1, *m, *m1; 443 GaimBlistNode *gnode,*bnode;
444 ZAsyncLocateData_t ald; 444 ZAsyncLocateData_t ald;
445 445
446 ald.user = NULL; 446 ald.user = NULL;
447 memset(&(ald.uid), 0, sizeof(ZUnique_Id_t)); 447 memset(&(ald.uid), 0, sizeof(ZUnique_Id_t));
448 ald.version = NULL; 448 ald.version = NULL;
449 449
450 gr = gaim_blist_groups(); 450 for(gnode = gaim_get_blist()->root; gnode; gnode = gnode->next) {
451 gr1 = gr; 451 if(!GAIM_BLIST_NODE_IS_GROUP(gnode))
452 while (gr1) { 452 continue;
453 struct group *g = gr1->data; 453 for(bnode = gnode->child; bnode; bnode = bnode->next) {
454 m = gaim_blist_members(g); 454 struct buddy *b = (struct buddy *)bnode;
455 m1 = m; 455 if(!GAIM_BLIST_NODE_IS_BUDDY(bnode))
456 while (m1) { 456 continue;
457 struct buddy *b = m1->data;
458 if(b->account->gc == zgc) { 457 if(b->account->gc == zgc) {
459 char *chk; 458 char *chk;
460 chk = zephyr_normalize(b->name); 459 chk = zephyr_normalize(b->name);
461 /* doesn't matter if this fails or not; we'll just move on to the next one */ 460 /* doesn't matter if this fails or not; we'll just move on to the next one */
462 ZRequestLocations(chk, &ald, UNACKED, ZAUTH); 461 ZRequestLocations(chk, &ald, UNACKED, ZAUTH);
463 free(ald.user); 462 free(ald.user);
464 free(ald.version); 463 free(ald.version);
465 } 464 }
466 m1 = m1->next; 465 }
467 } 466 }
468 g_slist_free(m);
469 gr1 = gr1->next;
470 }
471 g_slist_free(gr1);
472 467
473 return TRUE; 468 return TRUE;
474 } 469 }
475 470
476 static char *get_exposure_level() 471 static char *get_exposure_level()
667 fclose(fd); 662 fclose(fd);
668 } 663 }
669 664
670 static void write_anyone() 665 static void write_anyone()
671 { 666 {
672 GSList *gr, *gr1, *m, *m1; 667 GaimBlistNode *gnode,*bnode;
673 struct group *g;
674 struct buddy *b; 668 struct buddy *b;
675 char *ptr, *fname, *ptr2; 669 char *ptr, *fname, *ptr2;
676 FILE *fd; 670 FILE *fd;
677 671
678 fname = g_strdup_printf("%s/.anyone", gaim_home_dir()); 672 fname = g_strdup_printf("%s/.anyone", gaim_home_dir());
680 if (!fd) { 674 if (!fd) {
681 g_free(fname); 675 g_free(fname);
682 return; 676 return;
683 } 677 }
684 678
685 gr = gaim_blist_groups(); 679 for(gnode = gaim_get_blist()->root; gnode; gnode = gnode->next) {
686 gr1 = gr; 680 if(!GAIM_BLIST_NODE_IS_GROUP(gnode))
687 while (gr1) { 681 continue;
688 g = gr1->data; 682 for(bnode = gnode->child; bnode; bnode = bnode->next) {
689 m = gaim_blist_members(g); 683 if(!GAIM_BLIST_NODE_IS_BUDDY(bnode))
690 m1 = m; 684 continue;
691 while (m1) { 685 b = (struct buddy *)bnode;
692 b = m1->data;
693 if(b->account->gc == zgc) { 686 if(b->account->gc == zgc) {
694 if ((ptr = strchr(b->name, '@')) != NULL) { 687 if ((ptr = strchr(b->name, '@')) != NULL) {
695 ptr2 = ptr + 1; 688 ptr2 = ptr + 1;
696 /* We should only strip the realm name if the principal 689 /* We should only strip the realm name if the principal
697 is in the user's realm 690 is in the user's realm
702 } 695 }
703 fprintf(fd, "%s\n", b->name); 696 fprintf(fd, "%s\n", b->name);
704 if (ptr) 697 if (ptr)
705 *ptr = '@'; 698 *ptr = '@';
706 } 699 }
707 m1 = m1->next; 700 }
708 } 701 }
709 g_slist_free(m);
710 gr1 = gr1->next;
711 }
712 g_slist_free(gr);
713 702
714 fclose(fd); 703 fclose(fd);
715 g_free(fname); 704 g_free(fname);
716 } 705 }
717 706