comparison src/buddy_chat.c @ 391:be408b41c172

[gaim-migrate @ 401] Plugins got updated. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Mon, 12 Jun 2000 11:30:05 +0000
parents 1eae69f076d2
children a330017b3aa4
comparison
equal deleted inserted replaced
390:0890c6250e7e 391:be408b41c172
397 397
398 if (general_options & OPT_GEN_SEND_LINKS) { 398 if (general_options & OPT_GEN_SEND_LINKS) {
399 linkify_text(buf); 399 linkify_text(buf);
400 } 400 }
401 401
402 #ifdef GAIM_PLUGINS
403 {
404 GList *c = callbacks;
405 struct gaim_callback *g;
406 void (*function)(char *, char **, void *);
407 char *buffy = g_strdup(buf);
408 while (c) {
409 g = (struct gaim_callback *)c->data;
410 if (g->event == event_chat_send && g->function != NULL) {
411 function = g->function;
412 (*function)(b->name, &buffy, g->data);
413 }
414 c = c->next;
415 }
416 if (!buffy)
417 return;
418 g_snprintf(buf, sizeof buf, "%s", buffy);
419 g_free(buffy);
420 }
421 #endif
422
423
402 escape_text(buf); 424 escape_text(buf);
403 serv_chat_send(b->id, buf); 425 serv_chat_send(b->id, buf);
404 426
405 gtk_widget_grab_focus(GTK_WIDGET(b->entry)); 427 gtk_widget_grab_focus(GTK_WIDGET(b->entry));
406 428
516 538
517 void add_chat_buddy(struct buddy_chat *b, char *buddy) 539 void add_chat_buddy(struct buddy_chat *b, char *buddy)
518 { 540 {
519 char *name = g_strdup(buddy); 541 char *name = g_strdup(buddy);
520 542
543 #ifdef GAIM_PLUGINS
544 GList *c = callbacks;
545 struct gaim_callback *g;
546 void (*function)(char *, char *, void *);
547 while (c) {
548 g = (struct gaim_callback *)c->data;
549 if (g->event == event_chat_buddy_join && g->function != NULL) {
550 function = g->function;
551 (*function)(b->name, name, g->data);
552 }
553 c = c->next;
554 }
555 #endif
556
521 b->in_room = g_list_append(b->in_room, name); 557 b->in_room = g_list_append(b->in_room, name);
522 558
523 update_chat_list(b); 559 update_chat_list(b);
524 560
525 if (b->makesound && (sound_options & OPT_SOUND_CHAT_JOIN)) 561 if (b->makesound && (sound_options & OPT_SOUND_CHAT_JOIN))
530 566
531 567
532 void remove_chat_buddy(struct buddy_chat *b, char *buddy) 568 void remove_chat_buddy(struct buddy_chat *b, char *buddy)
533 { 569 {
534 GList *names = b->in_room; 570 GList *names = b->in_room;
571
572 #ifdef GAIM_PLUGINS
573 GList *c = callbacks;
574 struct gaim_callback *g;
575 void (*function)(char *, char *, void *);
576 while (c) {
577 g = (struct gaim_callback *)c->data;
578 if (g->event == event_chat_buddy_leave && g->function != NULL) {
579 function = g->function;
580 (*function)(b->name, buddy, g->data);
581 }
582 c = c->next;
583 }
584 #endif
535 585
536 while(names) { 586 while(names) {
537 if (!strcasecmp((char *)names->data, buddy)) { 587 if (!strcasecmp((char *)names->data, buddy)) {
538 b->in_room = g_list_remove(b->in_room, names->data); 588 b->in_room = g_list_remove(b->in_room, names->data);
539 update_chat_list(b); 589 update_chat_list(b);