comparison src/server.c @ 94:9f6ce50ffb78

[gaim-migrate @ 104] Woohoo, the landing of the plugins. Nearly everything necessary is here. The only thing missing is that you can't load a plugin without signing on first (at least, not without some trickery). committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sun, 09 Apr 2000 11:18:25 +0000
parents bfdc427b936d
children a9aa982272f9
comparison
equal deleted inserted replaced
93:5ca21b68eb29 94:9f6ce50ffb78
81 81
82 time(&t); 82 time(&t);
83 83
84 gettimeofday(&lag_tv, NULL); 84 gettimeofday(&lag_tv, NULL);
85 if (!(general_options & OPT_GEN_SHOW_LAGMETER)) 85 if (!(general_options & OPT_GEN_SHOW_LAGMETER))
86 serv_send_im(current_user->username, LAGOMETER_STR, 1); 86 serv_send_im(current_user->username, LAGOMETER_STR, 0);
87 87
88 if (report_idle != IDLE_GAIM) 88 if (report_idle != IDLE_GAIM)
89 return TRUE; 89 return TRUE;
90 90
91 91
135 135
136 136
137 void serv_send_im(char *name, char *message, int away) 137 void serv_send_im(char *name, char *message, int away)
138 { 138 {
139 char buf[MSG_LEN - 7]; 139 char buf[MSG_LEN - 7];
140
141 #ifdef GAIM_PLUGINS
142 GList *c = callbacks;
143 struct gaim_callback *g;
144 void (*function)(char **, char **, void *);
145 while (c) {
146 g = (struct gaim_callback *)c->data;
147 if (g->event == event_im_send && g->function != NULL) {
148 function = g->function;
149 /* I can guarantee you this is wrong */
150 (*function)(&name, &message, g->data);
151 }
152 c = c->next;
153 }
154 /* make sure no evil plugin is trying to crash gaim */
155 if (message == NULL)
156 return;
157 #endif
158
140 #ifndef USE_OSCAR 159 #ifndef USE_OSCAR
141 g_snprintf(buf, MSG_LEN - 8, "toc_send_im %s \"%s\"%s", normalize(name), 160 g_snprintf(buf, MSG_LEN - 8, "toc_send_im %s \"%s\"%s", normalize(name),
142 message, ((away) ? " auto" : "")); 161 message, ((away) ? " auto" : ""));
143 sflap_send(buf, strlen(buf), TYPE_DATA); 162 sflap_send(buf, strlen(buf), TYPE_DATA);
144 #else 163 #else
145 aim_send_im(NULL, normalize(name), ((away) ? AIM_IMFLAGS_AWAY : 0), message); 164 aim_send_im(NULL, normalize(name), ((away) ? 0 : AIM_IMFLAGS_AWAY), message);
146 #endif 165 #endif
147 if (!away) 166 if (!away)
148 serv_touch_idle(); 167 serv_touch_idle();
149 } 168 }
150 169
448 { 467 {
449 struct conversation *cnv; 468 struct conversation *cnv;
450 int is_idle = -1; 469 int is_idle = -1;
451 int new_conv = 0; 470 int new_conv = 0;
452 char *nname; 471 char *nname;
472
473 #ifdef GAIM_PLUGINS
474 GList *c = callbacks;
475 struct gaim_callback *g;
476 void (*function)(char **, char **, void *);
477 while (c) {
478 g = (struct gaim_callback *)c->data;
479 if (g->event == event_im_recv && g->function != NULL) {
480 function = g->function;
481 /* I can guarantee you this is wrong */
482 (*function)(&name, &message, g->data);
483 }
484 c = c->next;
485 }
486 /* make sure no evil plugin is trying to crash gaim */
487 if (message == NULL)
488 return;
489 #endif
453 490
454 nname = g_strdup(normalize(name)); 491 nname = g_strdup(normalize(name));
455 492
456 if (!strcasecmp(normalize(name), nname)) { 493 if (!strcasecmp(normalize(name), nname)) {
457 if (!(general_options & OPT_GEN_SHOW_LAGMETER)) 494 if (!(general_options & OPT_GEN_SHOW_LAGMETER))