comparison src/perl.c @ 4491:3196d9044a45

[gaim-migrate @ 4766] aim_user is dead. long live gaim_account. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Fri, 31 Jan 2003 13:03:47 +0000
parents 62c1e5e656d0
children 9df99116840a
comparison
equal deleted inserted replaced
4490:70b892694e0b 4491:3196d9044a45
572 break; 572 break;
573 case 4: 573 case 4:
574 { 574 {
575 struct gaim_connection *gc = (struct gaim_connection *)SvIV(ST(1)); 575 struct gaim_connection *gc = (struct gaim_connection *)SvIV(ST(1));
576 if (g_slist_find(connections, gc)) 576 if (g_slist_find(connections, gc))
577 XST_mIV(i++, g_slist_index(aim_users, gc->user)); 577 XST_mIV(i++, g_slist_index(gaim_accounts, gc->account));
578 else 578 else
579 XST_mIV(i++, -1); 579 XST_mIV(i++, -1);
580 } 580 }
581 break; 581 break;
582 case 5: 582 case 5:
583 { 583 {
584 GSList *a = aim_users; 584 GSList *a = gaim_accounts;
585 while (a) { 585 while (a) {
586 struct aim_user *u = a->data; 586 struct gaim_account *account = a->data;
587 XST_mPV(i++, u->username); 587 XST_mPV(i++, account->username);
588 a = a->next; 588 a = a->next;
589 } 589 }
590 } 590 }
591 break; 591 break;
592 case 6: 592 case 6:
593 { 593 {
594 GSList *a = aim_users; 594 GSList *a = gaim_accounts;
595 while (a) { 595 while (a) {
596 struct aim_user *u = a->data; 596 struct gaim_account *account = a->data;
597 XST_mIV(i++, u->protocol); 597 XST_mIV(i++, account->protocol);
598 a = a->next; 598 a = a->next;
599 } 599 }
600 } 600 }
601 break; 601 break;
602 case 7: 602 case 7:
646 while (list) { 646 while (list) {
647 g = (struct group *)list->data; 647 g = (struct group *)list->data;
648 mem = g->members; 648 mem = g->members;
649 while (mem) { 649 while (mem) {
650 buddy = (struct buddy *)mem->data; 650 buddy = (struct buddy *)mem->data;
651 if(buddy->user->gc == gc) 651 if(buddy->account == gc->account)
652 XST_mPV(i++, buddy->name); 652 XST_mPV(i++, buddy->name);
653 mem = mem->next; 653 mem = mem->next;
654 } 654 }
655 list = g_slist_next(list); 655 list = g_slist_next(list);
656 } 656 }
673 while (list) { 673 while (list) {
674 g = (struct group *)list->data; 674 g = (struct group *)list->data;
675 mem = g->members; 675 mem = g->members;
676 while (mem) { 676 while (mem) {
677 b = (struct buddy *)mem->data; 677 b = (struct buddy *)mem->data;
678 if (b->user->gc == gc && b->present) XST_mPV(i++, b->name); 678 if (b->account == gc->account && b->present) XST_mPV(i++, b->name);
679 mem = mem->next; 679 mem = mem->next;
680 } 680 }
681 list = g_slist_next(list); 681 list = g_slist_next(list);
682 } 682 }
683 XSRETURN(i); 683 XSRETURN(i);
692 692
693 command = SvPV(ST(0), junk); 693 command = SvPV(ST(0), junk);
694 if (!command) XSRETURN(0); 694 if (!command) XSRETURN(0);
695 if (!strncasecmp(command, "signon", 6)) { 695 if (!strncasecmp(command, "signon", 6)) {
696 int index = SvIV(ST(1)); 696 int index = SvIV(ST(1));
697 if (g_slist_nth_data(aim_users, index)) 697 if (g_slist_nth_data(gaim_accounts, index))
698 serv_login(g_slist_nth_data(aim_users, index)); 698 serv_login(g_slist_nth_data(gaim_accounts, index));
699 } else if (!strncasecmp(command, "signoff", 7)) { 699 } else if (!strncasecmp(command, "signoff", 7)) {
700 struct gaim_connection *gc = (struct gaim_connection *)SvIV(ST(1)); 700 struct gaim_connection *gc = (struct gaim_connection *)SvIV(ST(1));
701 if (g_slist_find(connections, gc)) signoff(gc); 701 if (g_slist_find(connections, gc)) signoff(gc);
702 else signoff_all(NULL, NULL); 702 else signoff_all(NULL, NULL);
703 } else if (!strncasecmp(command, "info", 4)) { 703 } else if (!strncasecmp(command, "info", 4)) {
742 dXSARGS; 742 dXSARGS;
743 items = 0; 743 items = 0;
744 744
745 gc = (struct gaim_connection *)SvIV(ST(0)); 745 gc = (struct gaim_connection *)SvIV(ST(0));
746 if (g_slist_find(connections, gc)) 746 if (g_slist_find(connections, gc))
747 buddy = find_buddy(gc->user, SvPV(ST(1), junk)); 747 buddy = find_buddy(gc->account, SvPV(ST(1), junk));
748 748
749 if (!buddy) 749 if (!buddy)
750 XSRETURN(0); 750 XSRETURN(0);
751 XST_mPV(0, buddy->name); 751 XST_mPV(0, buddy->name);
752 XST_mPV(1, get_buddy_alias(buddy)); 752 XST_mPV(1, get_buddy_alias(buddy));
833 } 833 }
834 834
835 c = gaim_find_conversation(nick); 835 c = gaim_find_conversation(nick);
836 836
837 if (!c) 837 if (!c)
838 c = gaim_conversation_new(GAIM_CONV_IM, gc->user, nick); 838 c = gaim_conversation_new(GAIM_CONV_IM, gc->account, nick);
839 else 839 else
840 gaim_conversation_set_user(c, gc->user); 840 gaim_conversation_set_account(c, gc->account);
841 841
842 gaim_conversation_write(c, NULL, what, -1, 842 gaim_conversation_write(c, NULL, what, -1,
843 (WFLAG_SEND | (isauto ? WFLAG_AUTO : 0)), 843 (WFLAG_SEND | (isauto ? WFLAG_AUTO : 0)),
844 time(NULL)); 844 time(NULL));
845 serv_send_im(gc, nick, what, -1, isauto ? IM_FLAG_AWAY : 0); 845 serv_send_im(gc, nick, what, -1, isauto ? IM_FLAG_AWAY : 0);