diff plugins/signals-test.c @ 8999:8f838ae3e710

[gaim-migrate @ 9774] " This patch renames the existing received-*-msg signals to receiving-*msg to fit the naming of other signals where a pointer to the message is passed (writing, sending, displaying) It adds new received-*-msg signals which are emitted after the receiving signals, in line with the other conversation signals (wrote, sent, displayed) This is necessary to allow plugins which depend on the final received message to work alongside plugins which may modify the message. One known example of this is festival-gaim alongside gaim-encryption - festival-gaim would try to "speak" the encrypted text: http://sf.net/tracker/?func=detail&aid=943216&group_id=89763&atid=591320 I've tested this with gaim-encryption and festival-gaim (locally modified so gaim-encryption uses the receiving signal and festival uses the received signal) All in-tree users of received-*-msg are updated to use receiving-*-msg if they do modify the message, the conversation-signals documentation is updated, the signals-test.c & signal-test.tcl plugins are also updated." --Stu Tomlinson committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Fri, 21 May 2004 14:33:32 +0000
parents 294ae6548d4e
children 826013efffcb
line wrap: on
line diff
--- a/plugins/signals-test.c	Fri May 21 14:26:31 2004 +0000
+++ b/plugins/signals-test.c	Fri May 21 14:33:32 2004 +0000
@@ -108,6 +108,19 @@
 	gaim_debug_misc("signals test", "buddy-signed-off (%s)\n", buddy->name);
 }
 
+static void
+buddy_extended_menu_cb(GaimBuddy *buddy, void *data)
+{
+	gaim_debug_misc("signals test", "buddy-extended-menu (%s)\n", buddy->name);
+}
+
+static void
+group_extended_menu_cb(GaimGroup *group, void *data)
+{
+	gaim_debug_misc("signals test", "group-extended-menu (%s)\n", group->name);
+}
+
+
 /**************************************************************************
  * Connection subsystem signal callbacks
  **************************************************************************/
@@ -175,16 +188,25 @@
 }
 
 static gboolean
-received_im_msg_cb(GaimAccount *account, char **sender, char **buffer,
+receiving_im_msg_cb(GaimAccount *account, char **sender, char **buffer,
 				   int *flags, void *data)
 {
-	gaim_debug_misc("signals test", "received-im-msg (%s, %s, %s, %d)\n",
+	gaim_debug_misc("signals test", "receiving-im-msg (%s, %s, %s, %d)\n",
 					gaim_account_get_username(account), *sender, *buffer,
 					*flags);
 
 	return FALSE;
 }
 
+static void
+received_im_msg_cb(GaimAccount *account, char *sender, char *buffer,
+				   int flags, void *data)
+{
+	gaim_debug_misc("signals test", "received-im-msg (%s, %s, %s, %d)\n",
+					gaim_account_get_username(account), sender, buffer,
+					flags);
+}
+
 static gboolean
 displaying_chat_msg_cb(GaimAccount *account, GaimConversation *conv,
 		       char **buffer, void *data)
@@ -219,11 +241,11 @@
 }
 
 static gboolean
-received_chat_msg_cb(GaimAccount *account, char **sender, char **buffer,
+receiving_chat_msg_cb(GaimAccount *account, char **sender, char **buffer,
 					 GaimConversation *chat, void *data)
 {
 	gaim_debug_misc("signals test",
-					"received-chat-msg (%s, %s, %s, %s, %s)\n",
+					"receiving-chat-msg (%s, %s, %s, %s)\n",
 					gaim_account_get_username(account), *sender, *buffer,
 					gaim_conversation_get_name(chat));
 
@@ -231,6 +253,16 @@
 }
 
 static void
+received_chat_msg_cb(GaimAccount *account, char *sender, char *buffer,
+					 GaimConversation *chat, void *data)
+{
+	gaim_debug_misc("signals test",
+					"received-chat-msg (%s, %s, %s, %s)\n",
+					gaim_account_get_username(account), sender, buffer,
+					gaim_conversation_get_name(chat));
+}
+
+static void
 conversation_switching_cb(GaimConversation *old_conv,
 						  GaimConversation *new_conv, void *data)
 {
@@ -384,6 +416,10 @@
 						plugin, GAIM_CALLBACK(buddy_signed_on_cb), NULL);
 	gaim_signal_connect(blist_handle, "buddy-signed-off",
 						plugin, GAIM_CALLBACK(buddy_signed_off_cb), NULL);
+	gaim_signal_connect(blist_handle, "buddy-extended-menu",
+						plugin, GAIM_CALLBACK(buddy_extended_menu_cb), NULL);
+	gaim_signal_connect(blist_handle, "group-extended-menu",
+						plugin, GAIM_CALLBACK(group_extended_menu_cb), NULL);
 
 	/* Connection subsystem signals */
 	gaim_signal_connect(conn_handle, "signing-on",
@@ -404,6 +440,8 @@
 						plugin, GAIM_CALLBACK(sending_im_msg_cb), NULL);
 	gaim_signal_connect(conv_handle, "sent-im-msg",
 						plugin, GAIM_CALLBACK(sent_im_msg_cb), NULL);
+	gaim_signal_connect(conv_handle, "receiving-im-msg",
+						plugin, GAIM_CALLBACK(receiving_im_msg_cb), NULL);
 	gaim_signal_connect(conv_handle, "received-im-msg",
 						plugin, GAIM_CALLBACK(received_im_msg_cb), NULL);
 	gaim_signal_connect(conv_handle, "displaying-chat-msg",
@@ -414,6 +452,8 @@
 						plugin, GAIM_CALLBACK(sending_chat_msg_cb), NULL);
 	gaim_signal_connect(conv_handle, "sent-chat-msg",
 						plugin, GAIM_CALLBACK(sent_chat_msg_cb), NULL);
+	gaim_signal_connect(conv_handle, "receiving-chat-msg",
+						plugin, GAIM_CALLBACK(receiving_chat_msg_cb), NULL);
 	gaim_signal_connect(conv_handle, "received-chat-msg",
 						plugin, GAIM_CALLBACK(received_chat_msg_cb), NULL);
 	gaim_signal_connect(conv_handle, "conversation-switching",