comparison src/server.c @ 780:c714def9cebb

[gaim-migrate @ 790] You may be a geek if... You've ever used a computer on Friday, Saturday and Sunday of the same weekend. You find yourself interrupting computer store salesman to correct something he said. The first thing you notice when walking in a business is their computer system. ...and offer advice on how you would change it. You've ever mounted a magnetic tape reel. You own any shareware. You know more IP addresses than phone numbers. You've ever accidentally dialed an IP address. Your friends use you as tech support. You've ever named a computer. You have your local computer store on speed dial. You can't carry on a conversation without talking about computers. Co-workers have to E-mail you about the fire alarm to get you out of the building. You've ever found "stray" diskettes when doing laundry. Your computer has it's own phone line - but your teenager doesn't. You check the national weather service web page for current weather conditions (rather than look out the window). You know more URLs than street addresses. Your pet has a web page. You get really excited when Yahoo adds your link. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Tue, 29 Aug 2000 03:59:01 +0000
parents 72e556f6b99d
children 57cc66fbfa8e
comparison
equal deleted inserted replaced
779:1823a4af82d3 780:c714def9cebb
98 if ((t - lastsent) > 600) { /* 15 minutes! */ 98 if ((t - lastsent) > 600) { /* 15 minutes! */
99 serv_set_idle((int)t - lastsent); 99 serv_set_idle((int)t - lastsent);
100 is_idle = 1; 100 is_idle = 1;
101 } 101 }
102 102
103 #ifdef GAIM_PLUGINS 103 plugin_event(event_blist_update, 0, 0, 0);
104 {
105 GList *c = callbacks;
106 struct gaim_callback *g;
107 void (*function)(void *);
108 while (c) {
109 g = (struct gaim_callback *)c->data;
110 if (g->event == event_blist_update &&
111 g->function != NULL) {
112 function = g->function;
113 (*function)(g->data);
114 }
115 c = c->next;
116 }
117 }
118 #endif
119 104
120 return TRUE; 105 return TRUE;
121 106
122 } 107 }
123 108
634 { 619 {
635 struct conversation *cnv; 620 struct conversation *cnv;
636 int is_idle = -1; 621 int is_idle = -1;
637 int new_conv = 0; 622 int new_conv = 0;
638 623
639 #ifdef GAIM_PLUGINS
640 GList *c = callbacks;
641 struct gaim_callback *g;
642 void (*function)(char **, char **, void *);
643 char *buffy = g_strdup(message); 624 char *buffy = g_strdup(message);
644 char *angel = g_strdup(name); 625 char *angel = g_strdup(name);
645 while (c) { 626 plugin_event(event_im_recv, &angel, &buffy, 0);
646 g = (struct gaim_callback *)c->data;
647 if (g->event == event_im_recv && g->function != NULL) {
648 function = g->function;
649 (*function)(&angel, &buffy, g->data);
650 }
651 c = c->next;
652 }
653 if (!buffy || !angel) 627 if (!buffy || !angel)
654 return; 628 return;
655 g_snprintf(message, strlen(message) + 1, "%s", buffy); 629 g_snprintf(message, strlen(message) + 1, "%s", buffy);
656 g_free(buffy); 630 g_free(buffy);
657 g_snprintf(name, strlen(name) + 1, "%s", angel); 631 g_snprintf(name, strlen(name) + 1, "%s", angel);
658 g_free(angel); 632 g_free(angel);
659 #endif
660 633
661 if ((general_options & OPT_GEN_TIK_HACK) && awaymessage && 634 if ((general_options & OPT_GEN_TIK_HACK) && awaymessage &&
662 !strcmp(message, ">>>Automated Message: Getting Away Message<<<")) 635 !strcmp(message, ">>>Automated Message: Getting Away Message<<<"))
663 { 636 {
664 serv_send_im(name, awaymessage->message, 1); 637 serv_send_im(name, awaymessage->message, 1);
796 769
797 } 770 }
798 771
799 b->idle = idle; 772 b->idle = idle;
800 b->evil = evil; 773 b->evil = evil;
801 #ifdef GAIM_PLUGINS 774
802 if ((b->uc & UC_UNAVAILABLE) && !(type & UC_UNAVAILABLE)) { 775 if ((b->uc & UC_UNAVAILABLE) && !(type & UC_UNAVAILABLE)) {
803 GList *c = callbacks; 776 plugin_event(event_buddy_back, b->name, 0, 0);
804 struct gaim_callback *g; 777 } else if (!(b->uc & UC_UNAVAILABLE) && (type & UC_UNAVAILABLE)) {
805 void (*function)(char *, void *); 778 plugin_event(event_buddy_away, b->name, 0, 0);
806 while (c) { 779 }
807 g = (struct gaim_callback *)c->data; 780
808 if (g->event == event_buddy_back &&
809 g->function != NULL) {
810 function = g->function;
811 (*function)(b->name, g->data);
812 }
813 c = c->next;
814 }
815 }
816 #endif
817 b->uc = type; 781 b->uc = type;
818 if (caps) b->caps = caps; 782 if (caps) b->caps = caps;
819 783
820 b->signon = signon; 784 b->signon = signon;
821 785
842 { 806 {
843 char *buf2 = g_malloc(1024); 807 char *buf2 = g_malloc(1024);
844 GtkWidget *d, *label, *close; 808 GtkWidget *d, *label, *close;
845 809
846 810
847 #ifdef GAIM_PLUGINS 811 plugin_event(event_warned, name, (void *)lev, 0);
848 GList *c = callbacks;
849 struct gaim_callback *g;
850 void (*function)(char *, int, void *);
851 while (c) {
852 g = (struct gaim_callback *)c->data;
853 if (g->event == event_warned && g->function != NULL) {
854 function = g->function;
855 (*function)(name, lev, g->data);
856 }
857 c = c->next;
858 }
859 #endif
860 812
861 g_snprintf(buf2, 1023, "You have just been warned by %s.\nYour new warning level is %d%%", 813 g_snprintf(buf2, 1023, "You have just been warned by %s.\nYour new warning level is %d%%",
862 ((name == NULL) ? "an anonymous person" : name) , lev); 814 ((name == NULL) ? "an anonymous person" : name) , lev);
863 815
864 816
914 GtkWidget *nobtn; 866 GtkWidget *nobtn;
915 867
916 char buf2[BUF_LONG]; 868 char buf2[BUF_LONG];
917 869
918 870
919 #ifdef GAIM_PLUGINS 871 plugin_event(event_chat_invited, who, name, message);
920 GList *c = callbacks;
921 struct gaim_callback *g;
922 void (*function)(char *, char *, char *, void *);
923 while (c) {
924 g = (struct gaim_callback *)c->data;
925 if (g->event == event_chat_invited && g->function != NULL) {
926 function = g->function;
927 (*function)(who, name, message, g->data);
928 }
929 c = c->next;
930 }
931 #endif
932 872
933 if (message) 873 if (message)
934 g_snprintf(buf2, sizeof(buf2), "User '%s' invites you to buddy chat room: '%s'\n%s", who, name, message); 874 g_snprintf(buf2, sizeof(buf2), "User '%s' invites you to buddy chat room: '%s'\n%s", who, name, message);
935 else 875 else
936 g_snprintf(buf2, sizeof(buf2), "User '%s' invites you to buddy chat room: '%s'\n", who, name); 876 g_snprintf(buf2, sizeof(buf2), "User '%s' invites you to buddy chat room: '%s'\n", who, name);
978 918
979 void serv_got_joined_chat(int id, char *name) 919 void serv_got_joined_chat(int id, char *name)
980 { 920 {
981 struct conversation *b; 921 struct conversation *b;
982 922
983 #ifdef GAIM_PLUGINS 923 plugin_event(event_chat_join, name, 0, 0);
984 GList *c = callbacks;
985 struct gaim_callback *g;
986 void (*function)(char *, void *);
987 while (c) {
988 g = (struct gaim_callback *)c->data;
989 if (g->event == event_chat_join && g->function != NULL) {
990 function = g->function;
991 (*function)(name, g->data);
992 }
993 c = c->next;
994 }
995 #endif
996 924
997 b = (struct conversation *)g_new0(struct conversation, 1); 925 b = (struct conversation *)g_new0(struct conversation, 1);
998 buddy_chats = g_list_append(buddy_chats, b); 926 buddy_chats = g_list_append(buddy_chats, b);
999 927
1000 b->is_chat = TRUE; 928 b->is_chat = TRUE;
1021 } 949 }
1022 950
1023 if (!b) 951 if (!b)
1024 return; 952 return;
1025 953
1026 #ifdef GAIM_PLUGINS 954 plugin_event(event_chat_leave, b->name, 0, 0);
1027 {
1028 GList *c = callbacks;
1029 struct gaim_callback *g;
1030 void (*function)(char *, void *);
1031 while (c) {
1032 g = (struct gaim_callback *)c->data;
1033 if (g->event == event_chat_leave && g->function != NULL) {
1034 function = g->function;
1035 (*function)(b->name, g->data);
1036 }
1037 c = c->next;
1038 }
1039 }
1040 #endif
1041 955
1042 sprintf(debug_buff, "Leaving room %s.\n", b->name); 956 sprintf(debug_buff, "Leaving room %s.\n", b->name);
1043 debug_print(debug_buff); 957 debug_print(debug_buff);
1044 958
1045 buddy_chats = g_list_remove(buddy_chats, b); 959 buddy_chats = g_list_remove(buddy_chats, b);
1062 976
1063 } 977 }
1064 if (!b) 978 if (!b)
1065 return; 979 return;
1066 980
1067 #ifdef GAIM_PLUGINS 981 plugin_event(event_chat_recv, b->name, who, message);
1068 {
1069 GList *c = callbacks;
1070 struct gaim_callback *g;
1071 void (*function)(char *, char *, char *, void *);
1072 while (c) {
1073 g = (struct gaim_callback *)c->data;
1074 if (g->event == event_chat_recv && g->function != NULL) {
1075 function = g->function;
1076 (*function)(b->name, who, message, g->data);
1077 }
1078 c = c->next;
1079 }
1080 }
1081 #endif
1082 982
1083 if (whisper) 983 if (whisper)
1084 w = WFLAG_WHISPER; 984 w = WFLAG_WHISPER;
1085 else 985 else
1086 w = 0; 986 w = 0;