# HG changeset patch # User Eric Warmenhoven # Date 955321424 0 # Node ID a9aa982272f935b21675467e40ab148a440cb000 # Parent da0883dfa7db214a4c686b930d4a3a7149880cba [gaim-migrate @ 111] Heh, this is a good thing to fix. Before, if you send an IM, you can change it going out, but on your converation window, it would look unchanged. Now, if a plugin changes the outgoing text, the conversation window displays the new text. committer: Tailor Script diff -r da0883dfa7db -r a9aa982272f9 src/conversation.c --- a/src/conversation.c Sun Apr 09 20:48:48 2000 +0000 +++ b/src/conversation.c Sun Apr 09 23:03:44 2000 +0000 @@ -325,7 +325,7 @@ static void send_callback(GtkWidget *widget, struct conversation *c) { - char buf[BUF_LEN*4]; + char *buf = g_malloc(BUF_LEN * 4); char *buf2; gchar *buf4; int hdrlen; @@ -372,6 +372,22 @@ g_snprintf(buf2, BUF_LONG, "%s", buf); strcpy(buf, buf2); } + +#ifdef GAIM_PLUGINS + { + GList *ca = callbacks; + struct gaim_callback *g; + void (*function)(char *, char **, void *); + while (ca) { + g = (struct gaim_callback *)(ca->data); + if (g->event == event_im_send && g->function != NULL) { + function = g->function; + (*function)(c->name, &buf, g->data); + } + ca = ca->next; + } + } +#endif write_to_conv(c, buf, WFLAG_SEND); @@ -402,7 +418,7 @@ gtk_widget_grab_focus(c->entry); g_free(buf2); - + g_free(buf); } static int diff -r da0883dfa7db -r a9aa982272f9 src/server.c --- a/src/server.c Sun Apr 09 20:48:48 2000 +0000 +++ b/src/server.c Sun Apr 09 23:03:44 2000 +0000 @@ -138,24 +138,6 @@ { char buf[MSG_LEN - 7]; -#ifdef GAIM_PLUGINS - GList *c = callbacks; - struct gaim_callback *g; - void (*function)(char **, char **, void *); - while (c) { - g = (struct gaim_callback *)c->data; - if (g->event == event_im_send && g->function != NULL) { - function = g->function; - /* I can guarantee you this is wrong */ - (*function)(&name, &message, g->data); - } - c = c->next; - } - /* make sure no evil plugin is trying to crash gaim */ - if (message == NULL) - return; -#endif - #ifndef USE_OSCAR g_snprintf(buf, MSG_LEN - 8, "toc_send_im %s \"%s\"%s", normalize(name), message, ((away) ? " auto" : ""));