diff src/conversation.c @ 101:a9aa982272f9

[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 <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sun, 09 Apr 2000 23:03:44 +0000
parents 78166fb457f1
children 8c301530b2a3
line wrap: on
line diff
--- 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, "<STRIKE>%s</STRIKE>", 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