diff 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
line wrap: on
line diff
--- a/src/buddy_chat.c	Mon Jun 12 08:11:26 2000 +0000
+++ b/src/buddy_chat.c	Mon Jun 12 11:30:05 2000 +0000
@@ -399,6 +399,28 @@
 		linkify_text(buf);
 	}
 
+#ifdef GAIM_PLUGINS
+	{
+	GList *c = callbacks;
+	struct gaim_callback *g;
+	void (*function)(char *, char **, void *);
+	char *buffy = g_strdup(buf);
+	while (c) {
+		g = (struct gaim_callback *)c->data;
+		if (g->event == event_chat_send && g->function != NULL) {
+			function = g->function;
+			(*function)(b->name, &buffy, g->data);
+		}
+		c = c->next;
+	}
+	if (!buffy)
+		return;
+	g_snprintf(buf, sizeof buf, "%s", buffy);
+	g_free(buffy);
+	}
+#endif
+
+
         escape_text(buf);
         serv_chat_send(b->id, buf);
         
@@ -518,6 +540,20 @@
 {
         char *name = g_strdup(buddy);
 
+#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_chat_buddy_join && g->function != NULL) {
+			function = g->function;
+			(*function)(b->name, name, g->data);
+		}
+		c = c->next;
+	}
+#endif
+
         b->in_room = g_list_append(b->in_room, name);
 
         update_chat_list(b);
@@ -533,6 +569,20 @@
 {	
         GList *names = b->in_room;
 
+#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_chat_buddy_leave && g->function != NULL) {
+			function = g->function;
+			(*function)(b->name, buddy, g->data);
+		}
+		c = c->next;
+	}
+#endif
+
         while(names) {
                 if (!strcasecmp((char *)names->data, buddy)) {
                         b->in_room = g_list_remove(b->in_room, names->data);