changeset 6780:e9a730ad5a3c

[gaim-migrate @ 7319] Fixed the prototypes and signal registration for displaying-im-msg, displayed-im-msg, displaying-chat-msg, and displayed-chat-msg. This fixes the text replacement plugin (with a minor change or two there as well). committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sun, 07 Sep 2003 20:02:45 +0000
parents f5c483cdd1d8
children 0489da496f33
files plugins/spellchk.c src/conversation.c
diffstat 2 files changed, 24 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/spellchk.c	Sun Sep 07 16:22:58 2003 +0000
+++ b/plugins/spellchk.c	Sun Sep 07 20:02:45 2003 +0000
@@ -31,7 +31,7 @@
 static void substitute(char **, int, int, const char *);
 static GtkListStore *model;
 
-static void
+static gboolean
 substitute_words(GaimAccount *account, GaimConversation *conv,
 				 char **message, void *data)
 {
@@ -40,7 +40,7 @@
 	char *tmp;
 
 	if (message == NULL || *message == NULL)
-		return;
+		return FALSE;
 
 	l = num_words(*message);
 	for (i = 0; i < l; i++) {
@@ -69,6 +69,8 @@
 			} while(gtk_tree_model_iter_next(GTK_TREE_MODEL(model), &iter));
 		}
 	}
+
+	return FALSE;
 }
 
 static int buf_get_line(char *ibuf, char **buf, int *position, int len) {
@@ -382,9 +384,9 @@
 
 	load_conf();
 
-	gaim_signal_connect(conv_handle, "sending-im-msg",
+	gaim_signal_connect(conv_handle, "displaying-im-msg",
 						plugin, GAIM_CALLBACK(substitute_words), NULL);
-	gaim_signal_connect(conv_handle, "sending-chat-msg",
+	gaim_signal_connect(conv_handle, "displaying-chat-msg",
 						plugin, GAIM_CALLBACK(substitute_words), NULL);
 
 	return TRUE;
--- a/src/conversation.c	Sun Sep 07 16:22:58 2003 +0000
+++ b/src/conversation.c	Sun Sep 07 20:02:45 2003 +0000
@@ -230,7 +230,7 @@
 			gaim_conversations_get_handle(),
 			(type == GAIM_CONV_IM
 			 ? "displaying-im-msg" : "displaying-chat-msg"),
-			conv, &buffy));
+			gaim_conversation_get_account(conv), conv, &buffy));
 
 	if (buffy == NULL) {
 		g_free(buf2);
@@ -250,7 +250,7 @@
 
 	gaim_signal_emit(gaim_conversations_get_handle(),
 		(type == GAIM_CONV_IM ? "displayed-im-msg" : "displayed-chat-msg"),
-		conv, buffy);
+		gaim_conversation_get_account(conv), conv, buffy);
 
 	if (type == GAIM_CONV_IM) {
 		GaimIm *im = GAIM_IM(conv);
@@ -2619,16 +2619,21 @@
 
 	/* Register signals */
 	gaim_signal_register(handle, "displaying-im-msg",
-						 gaim_marshal_BOOLEAN__POINTER_POINTER,
-						 gaim_value_new(GAIM_TYPE_BOOLEAN), 2,
+						 gaim_marshal_BOOLEAN__POINTER_POINTER_POINTER,
+						 gaim_value_new(GAIM_TYPE_BOOLEAN), 3,
 						 gaim_value_new(GAIM_TYPE_SUBTYPE,
 										GAIM_SUBTYPE_ACCOUNT),
+						 gaim_value_new(GAIM_TYPE_SUBTYPE,
+										GAIM_SUBTYPE_CONVERSATION),
 						 gaim_value_new_outgoing(GAIM_TYPE_STRING));
 
 	gaim_signal_register(handle, "displayed-im-msg",
-						 gaim_marshal_VOID__POINTER_POINTER, NULL, 2,
+						 gaim_marshal_VOID__POINTER_POINTER_POINTER,
+						 NULL, 3,
 						 gaim_value_new(GAIM_TYPE_SUBTYPE,
 										GAIM_SUBTYPE_ACCOUNT),
+						 gaim_value_new(GAIM_TYPE_SUBTYPE,
+										GAIM_SUBTYPE_CONVERSATION),
 						 gaim_value_new(GAIM_TYPE_STRING));
 
 	gaim_signal_register(handle, "sending-im-msg",
@@ -2657,16 +2662,21 @@
 						 gaim_value_new_outgoing(GAIM_TYPE_UINT));
 
 	gaim_signal_register(handle, "displaying-chat-msg",
-						 gaim_marshal_BOOLEAN__POINTER_POINTER,
-						 gaim_value_new(GAIM_TYPE_BOOLEAN), 2,
+						 gaim_marshal_BOOLEAN__POINTER_POINTER_POINTER,
+						 gaim_value_new(GAIM_TYPE_BOOLEAN), 3,
 						 gaim_value_new(GAIM_TYPE_SUBTYPE,
 										GAIM_SUBTYPE_ACCOUNT),
+						 gaim_value_new(GAIM_TYPE_SUBTYPE,
+										GAIM_SUBTYPE_CONVERSATION),
 						 gaim_value_new_outgoing(GAIM_TYPE_STRING));
 
 	gaim_signal_register(handle, "displayed-chat-msg",
-						 gaim_marshal_VOID__POINTER_POINTER, NULL, 2,
+						 gaim_marshal_VOID__POINTER_POINTER_POINTER,
+						 NULL, 3,
 						 gaim_value_new(GAIM_TYPE_SUBTYPE,
 										GAIM_SUBTYPE_ACCOUNT),
+						 gaim_value_new(GAIM_TYPE_SUBTYPE,
+										GAIM_SUBTYPE_CONVERSATION),
 						 gaim_value_new(GAIM_TYPE_STRING));
 
 	gaim_signal_register(handle, "sending-chat-msg",