comparison src/server.c @ 1000:91b7377e7b45

[gaim-migrate @ 1010] Plugins work again, I think. There may still be some bugginess. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Mon, 16 Oct 2000 20:11:18 +0000
parents d2d6be9c85fe
children 1d8f05ea6bdf
comparison
equal deleted inserted replaced
999:0b5db8cdd30f 1000:91b7377e7b45
82 time_t t; 82 time_t t;
83 83
84 /* Not idle, really... :) */ 84 /* Not idle, really... :) */
85 update_all_buddies(); 85 update_all_buddies();
86 86
87 plugin_event(event_blist_update, 0, 0, 0); 87 plugin_event(event_blist_update, 0, 0, 0, 0);
88 88
89 time(&t); 89 time(&t);
90 90
91 if (report_idle != IDLE_GAIM) 91 if (report_idle != IDLE_GAIM)
92 return TRUE; 92 return TRUE;
450 int is_idle = -1; 450 int is_idle = -1;
451 int new_conv = 0; 451 int new_conv = 0;
452 452
453 char *buffy = g_strdup(message); 453 char *buffy = g_strdup(message);
454 char *angel = g_strdup(name); 454 char *angel = g_strdup(name);
455 plugin_event(event_im_recv, &angel, &buffy, 0); 455 plugin_event(event_im_recv, gc, &angel, &buffy, 0);
456 if (!buffy || !angel) 456 if (!buffy || !angel)
457 return; 457 return;
458 g_snprintf(message, strlen(message) + 1, "%s", buffy); 458 g_snprintf(message, strlen(message) + 1, "%s", buffy);
459 g_free(buffy); 459 g_free(buffy);
460 g_snprintf(name, strlen(name) + 1, "%s", angel); 460 g_snprintf(name, strlen(name) + 1, "%s", angel);
601 601
602 /* okay lets save the new config... */ 602 /* okay lets save the new config... */
603 603
604 } 604 }
605 605
606 if (!b->idle && idle) plugin_event(event_buddy_idle, b->name, 0, 0, 0);
607 if (b->idle && !idle) plugin_event(event_buddy_unidle, b->name, 0, 0, 0);
608
606 b->idle = idle; 609 b->idle = idle;
607 b->evil = evil; 610 b->evil = evil;
608 611
609 if ((b->uc & UC_UNAVAILABLE) && !(type & UC_UNAVAILABLE)) { 612 if ((b->uc & UC_UNAVAILABLE) && !(type & UC_UNAVAILABLE)) {
610 plugin_event(event_buddy_back, b->name, 0, 0); 613 plugin_event(event_buddy_back, b->name, 0, 0, 0);
611 } else if (!(b->uc & UC_UNAVAILABLE) && (type & UC_UNAVAILABLE)) { 614 } else if (!(b->uc & UC_UNAVAILABLE) && (type & UC_UNAVAILABLE)) {
612 plugin_event(event_buddy_away, b->name, 0, 0); 615 plugin_event(event_buddy_away, b->name, 0, 0, 0);
613 } 616 }
614 617
615 b->uc = type; 618 b->uc = type;
616 if (caps) b->caps = caps; 619 if (caps) b->caps = caps;
617 620
640 { 643 {
641 char *buf2 = g_malloc(1024); 644 char *buf2 = g_malloc(1024);
642 GtkWidget *d, *label, *close; 645 GtkWidget *d, *label, *close;
643 646
644 647
645 plugin_event(event_warned, name, (void *)lev, 0); 648 plugin_event(event_warned, name, (void *)lev, 0, 0);
646 649
647 g_snprintf(buf2, 1023, "You have just been warned by %s.\nYour new warning level is %d%%", 650 g_snprintf(buf2, 1023, "You have just been warned by %s.\nYour new warning level is %d%%",
648 ((name == NULL) ? "an anonymous person" : name) , lev); 651 ((name == NULL) ? "an anonymous person" : name) , lev);
649 652
650 653
702 GtkWidget *nobtn; 705 GtkWidget *nobtn;
703 706
704 char buf2[BUF_LONG]; 707 char buf2[BUF_LONG];
705 708
706 709
707 plugin_event(event_chat_invited, who, name, message); 710 plugin_event(event_chat_invited, g, who, name, message);
708 711
709 if (message) 712 if (message)
710 g_snprintf(buf2, sizeof(buf2), "User '%s' invites %s to buddy chat room: '%s'\n%s", who, g->username, name, message); 713 g_snprintf(buf2, sizeof(buf2), "User '%s' invites %s to buddy chat room: '%s'\n%s", who, g->username, name, message);
711 else 714 else
712 g_snprintf(buf2, sizeof(buf2), "User '%s' invites %s to buddy chat room: '%s'\n", who, g->username, name); 715 g_snprintf(buf2, sizeof(buf2), "User '%s' invites %s to buddy chat room: '%s'\n", who, g->username, name);
748 751
749 void serv_got_joined_chat(struct gaim_connection *gc, int id, char *name) 752 void serv_got_joined_chat(struct gaim_connection *gc, int id, char *name)
750 { 753 {
751 struct conversation *b; 754 struct conversation *b;
752 755
753 plugin_event(event_chat_join, name, 0, 0); 756 plugin_event(event_chat_join, gc, name, 0, 0);
754 757
755 b = (struct conversation *)g_new0(struct conversation, 1); 758 b = (struct conversation *)g_new0(struct conversation, 1);
756 gc->buddy_chats = g_slist_append(gc->buddy_chats, b); 759 gc->buddy_chats = g_slist_append(gc->buddy_chats, b);
757 760
758 b->is_chat = TRUE; 761 b->is_chat = TRUE;
798 } 801 }
799 802
800 if (!b) 803 if (!b)
801 return; 804 return;
802 805
803 plugin_event(event_chat_leave, b->name, 0, 0); 806 plugin_event(event_chat_leave, g, b->name, 0, 0);
804 807
805 sprintf(debug_buff, "Leaving room %s.\n", b->name); 808 sprintf(debug_buff, "Leaving room %s.\n", b->name);
806 debug_print(debug_buff); 809 debug_print(debug_buff);
807 810
808 g->buddy_chats = g_slist_remove(g->buddy_chats, b); 811 g->buddy_chats = g_slist_remove(g->buddy_chats, b);
825 828
826 } 829 }
827 if (!b) 830 if (!b)
828 return; 831 return;
829 832
830 plugin_event(event_chat_recv, b->name, who, message); 833 plugin_event(event_chat_recv, g, b->name, who, message);
831 834
832 if (whisper) 835 if (whisper)
833 w = WFLAG_WHISPER; 836 w = WFLAG_WHISPER;
834 else 837 else
835 w = 0; 838 w = 0;