/pidgin/main: 637a1a87c4d3: Switch sending-chat-msg to PurpleMes...

Tomasz Wasilczyk <[email protected]>
Newsgroups gmane.comp.gnome.gaim.cvs
Message-ID <[email protected]>
Changeset: 637a1a87c4d3ce3208d5e37af9f5bb7fa8d008e4
Author:	 Tomasz Wasilczyk <[email protected]>
Date:	 2014-05-22 16:42 +0200
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/637a1a87c4d3

Description:

Switch sending-chat-msg to PurpleMessage

diffstat:

 libpurple/conversation.c         |  5 ++---
 libpurple/conversations.c        |  6 ++----
 libpurple/plugins/signals-test.c |  5 +++--
 libpurple/protocols/irc/cmds.c   |  5 +++--
 4 files changed, 10 insertions(+), 11 deletions(-)

diffs (64 lines):

diff --git a/libpurple/conversation.c b/libpurple/conversation.c
--- a/libpurple/conversation.c
+++ b/libpurple/conversation.c
@@ -158,9 +158,8 @@ common_send(PurpleConversation *conv, co
 
 		msg = purple_message_new(NULL, sent, msgflags);
 
-		/* TODO: use msg! */
-		purple_signal_emit(purple_conversations_get_handle(), "sending-chat-msg",
-						 account, &sent, id);
+		purple_signal_emit(purple_conversations_get_handle(),
+			"sending-chat-msg", account, msg, id);
 
 		if (!purple_message_is_empty(msg)) {
 			err = purple_serv_chat_send(gc, id, msg);
diff --git a/libpurple/conversations.c b/libpurple/conversations.c
--- a/libpurple/conversations.c
+++ b/libpurple/conversations.c
@@ -343,10 +343,8 @@ purple_conversations_init(void)
 						 G_TYPE_STRING, PURPLE_TYPE_CHAT_CONVERSATION, G_TYPE_UINT);
 
 	purple_signal_register(handle, "sending-chat-msg",
-						 purple_marshal_VOID__POINTER_POINTER_UINT, G_TYPE_NONE,
-						 3, PURPLE_TYPE_ACCOUNT,
-						 G_TYPE_POINTER, /* pointer to a string */
-						 G_TYPE_UINT);
+		purple_marshal_VOID__POINTER_POINTER_UINT, G_TYPE_NONE,
+		3, PURPLE_TYPE_ACCOUNT, PURPLE_TYPE_MESSAGE, G_TYPE_UINT);
 
 	purple_signal_register(handle, "sent-chat-msg",
 						 purple_marshal_VOID__POINTER_POINTER_UINT, G_TYPE_NONE,
diff --git a/libpurple/plugins/signals-test.c b/libpurple/plugins/signals-test.c
--- a/libpurple/plugins/signals-test.c
+++ b/libpurple/plugins/signals-test.c
@@ -356,10 +356,11 @@ wrote_chat_msg_cb(PurpleAccount *account
 }
 
 static gboolean
-sending_chat_msg_cb(PurpleAccount *account, char **buffer, int id, void *data)
+sending_chat_msg_cb(PurpleAccount *account, PurpleMessage *msg, int id, void *data)
 {
 	purple_debug_misc("signals test", "sending-chat-msg (%s, %s, %d)\n",
-					purple_account_get_username(account), *buffer, id);
+		purple_account_get_username(account),
+		purple_message_get_contents(msg), id);
 
 	return FALSE;
 }
diff --git a/libpurple/protocols/irc/cmds.c b/libpurple/protocols/irc/cmds.c
--- a/libpurple/protocols/irc/cmds.c
+++ b/libpurple/protocols/irc/cmds.c
@@ -114,9 +114,10 @@ int irc_cmd_ctcp_action(struct irc_conn 
 		purple_signal_emit(purple_conversations_get_handle(),
 			"sending-im-msg", irc->account, pmsg);
 	} else {
-		/* TODO: pmsg! */
+		pmsg = purple_message_new(NULL, msg, PURPLE_MESSAGE_SEND);
+
 		purple_signal_emit(purple_conversations_get_handle(),
-			"sending-chat-msg", irc->account, &msg,
+			"sending-chat-msg", irc->account, pmsg,
 			purple_chat_conversation_get_id(PURPLE_CHAT_CONVERSATION(convo)));
 	}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.