comparison plugins/irc.c @ 1504:cac3efeb4d9c

[gaim-migrate @ 1514] added NICK and QUIT to irc; added rename_chat_buddy to buddy_chat to facilitate NICK committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sun, 25 Feb 2001 23:02:11 +0000
parents de0b946e86a4
children 7cb0cebd6d87
comparison
equal deleted inserted replaced
1503:1a1a58499a1c 1504:cac3efeb4d9c
610 } 610 }
611 611
612 return; 612 return;
613 } 613 }
614 614
615 if ((strstr(buf, " NICK ")) && (buf[0] == ':') && (!strstr(buf, " NOTICE "))) {
616
617 gchar old[128];
618 gchar new[128];
619
620 GList *templist;
621
622 struct irc_channel *channel;
623 int id;
624 int j;
625
626 for (j = 0, i = 1; buf[i] != '!'; j++, i++) {
627 old[j] = buf[i];
628 }
629
630 old[j] = '\0';
631 i++;
632
633 for (j = 0; buf[i] != ':'; j++, i++) {
634 }
635
636 i++;
637 strcpy(new, buf + i);
638
639 g_strchomp(new);
640
641 templist = ((struct irc_data *)gc->proto_data)->channels;
642
643 while (templist) {
644 struct conversation *convo = NULL;
645 channel = templist->data;
646
647 convo = find_conversation_by_id(gc, channel->id);
648
649 rename_chat_buddy(convo, old, new);
650
651 templist = templist->next;
652 }
653 }
654
655 if ((strstr(buf, "QUIT ")) && (buf[0] == ':') && (!strstr(buf, " NOTICE "))) {
656
657 gchar u_nick[128];
658
659 GList *templist;
660
661 struct irc_channel *channel;
662 int j;
663
664 for (j = 0, i = 1; buf[i] != '!'; j++, i++) {
665 u_nick[j] = buf[i];
666 }
667
668 u_nick[j] = '\0';
669
670 templist = ((struct irc_data *)gc->proto_data)->channels;
671
672 while (templist) {
673 struct conversation *convo = NULL;
674 channel = templist->data;
675
676 convo = find_conversation_by_id(gc, channel->id);
677
678 remove_chat_buddy(convo, u_nick);
679
680 templist = templist->next;
681 }
682 }
683
615 if ((strstr(buf, " PART ")) && (buf[0] == ':') && (!strstr(buf, " NOTICE "))) { 684 if ((strstr(buf, " PART ")) && (buf[0] == ':') && (!strstr(buf, " NOTICE "))) {
616 685
617 gchar u_channel[128]; 686 gchar u_channel[128];
618 gchar u_nick[128]; 687 gchar u_nick[128];
619 688