# HG changeset patch
# Node ID 2e29d1b2967f
# Parent  2dce52f93848
diff --git a/libpurple/protocols/bonjour/bonjour.c b/libpurple/protocols/bonjour/bonjour.c
--- a/libpurple/protocols/bonjour/bonjour.c
+++ b/libpurple/protocols/bonjour/bonjour.c
@@ -242,7 +242,9 @@
 
 static int
 bonjour_send_im(G_GNUC_UNUSED PurpleProtocolIM *im,
-                PurpleConnection *connection, PurpleMessage *msg)
+                PurpleConnection *connection,
+                G_GNUC_UNUSED PurpleConversation *conversation,
+                PurpleMessage *msg)
 {
 	BonjourData *bd = purple_connection_get_protocol_data(connection);
 
diff --git a/libpurple/protocols/demo/purpledemoprotocolim.c b/libpurple/protocols/demo/purpledemoprotocolim.c
--- a/libpurple/protocols/demo/purpledemoprotocolim.c
+++ b/libpurple/protocols/demo/purpledemoprotocolim.c
@@ -59,7 +59,9 @@
 
 static gint
 purple_demo_protocol_send_im(G_GNUC_UNUSED PurpleProtocolIM *im,
-                             PurpleConnection *conn, PurpleMessage *msg)
+                             PurpleConnection *conn,
+                             G_GNUC_UNUSED PurpleConversation *conversation,
+                             PurpleMessage *msg)
 {
 	const gchar *who = purple_message_get_recipient(msg);
 
diff --git a/libpurple/protocols/gg/message-prpl.h b/libpurple/protocols/gg/message-prpl.h
--- a/libpurple/protocols/gg/message-prpl.h
+++ b/libpurple/protocols/gg/message-prpl.h
@@ -43,7 +43,7 @@
 void ggp_message_got_multilogon(PurpleConnection *gc,
 	const struct gg_event_msg *ev);
 
-int ggp_message_send_im(PurpleProtocolIM *im, PurpleConnection *gc, PurpleMessage *msg);
+int ggp_message_send_im(PurpleProtocolIM *im, PurpleConnection *gc, PurpleConversation *conversation, PurpleMessage *msg);
 gchar * ggp_message_format_to_gg(PurpleConversation *conv, const gchar *text);
 
 #endif /* PURPLE_GG_MESSAGE_PRPL_H */
diff --git a/libpurple/protocols/gg/message-prpl.c b/libpurple/protocols/gg/message-prpl.c
--- a/libpurple/protocols/gg/message-prpl.c
+++ b/libpurple/protocols/gg/message-prpl.c
@@ -653,7 +653,9 @@
 
 int
 ggp_message_send_im(G_GNUC_UNUSED PurpleProtocolIM *pim,
-                    PurpleConnection *gc, PurpleMessage *msg)
+                    PurpleConnection *gc,
+                    G_GNUC_UNUSED PurpleConversation *conversation,
+                    PurpleMessage *msg)
 {
 	GGPInfo *info = purple_connection_get_protocol_data(gc);
 	PurpleConversation *im;
diff --git a/libpurple/protocols/ircv3/purpleircv3protocolim.c b/libpurple/protocols/ircv3/purpleircv3protocolim.c
--- a/libpurple/protocols/ircv3/purpleircv3protocolim.c
+++ b/libpurple/protocols/ircv3/purpleircv3protocolim.c
@@ -28,6 +28,7 @@
 static gint
 purple_ircv3_protocol_send_im(G_GNUC_UNUSED PurpleProtocolIM *im,
                               PurpleConnection *conn,
+                              G_GNUC_UNUSED PurpleConversation *conversation,
                               PurpleMessage *message)
 {
 	PurpleIRCv3Connection *connection = PURPLE_IRCV3_CONNECTION(conn);
diff --git a/libpurple/protocols/jabber/jabber.c b/libpurple/protocols/jabber/jabber.c
--- a/libpurple/protocols/jabber/jabber.c
+++ b/libpurple/protocols/jabber/jabber.c
@@ -2305,7 +2305,7 @@
 
 	msg = purple_message_new_outgoing(me, who, args[1], 0);
 
-	jabber_message_send_im(PURPLE_PROTOCOL_IM(prpl), pc, msg);
+	jabber_message_send_im(PURPLE_PROTOCOL_IM(prpl), pc, NULL, msg);
 
 	g_free(who);
 	return PURPLE_CMD_RET_OK;
diff --git a/libpurple/protocols/jabber/message.h b/libpurple/protocols/jabber/message.h
--- a/libpurple/protocols/jabber/message.h
+++ b/libpurple/protocols/jabber/message.h
@@ -71,7 +71,7 @@
 void jabber_message_send(JabberMessage *jm);
 
 void jabber_message_parse(JabberStream *js, PurpleXmlNode *packet);
-int jabber_message_send_im(PurpleProtocolIM *pim, PurpleConnection *gc, PurpleMessage *msg);
+int jabber_message_send_im(PurpleProtocolIM *pim, PurpleConnection *gc, PurpleConversation *conversation, PurpleMessage *msg);
 int jabber_message_send_chat(PurpleProtocolChat *protocol_chat, PurpleConnection *gc, int id, PurpleMessage *msg);
 
 unsigned int jabber_send_typing(PurpleProtocolIM *pim, PurpleConnection *gc, const char *who, PurpleIMTypingState state);
diff --git a/libpurple/protocols/jabber/message.c b/libpurple/protocols/jabber/message.c
--- a/libpurple/protocols/jabber/message.c
+++ b/libpurple/protocols/jabber/message.c
@@ -842,7 +842,9 @@
 
 int
 jabber_message_send_im(G_GNUC_UNUSED PurpleProtocolIM *pim,
-                       PurpleConnection *gc, PurpleMessage *msg)
+                       PurpleConnection *gc,
+                       G_GNUC_UNUSED PurpleConversation *conversation,
+                       PurpleMessage *msg)
 {
 	JabberMessage *jm;
 	JabberBuddy *jb;
diff --git a/libpurple/purpleprotocolim.h b/libpurple/purpleprotocolim.h
--- a/libpurple/purpleprotocolim.h
+++ b/libpurple/purpleprotocolim.h
@@ -31,6 +31,7 @@
 #include <glib-object.h>
 
 #include <libpurple/connection.h>
+#include <libpurple/purpleconversation.h>
 #include <libpurple/purpleprotocol.h>
 
 #define PURPLE_TYPE_PROTOCOL_IM (purple_protocol_im_get_type())
@@ -71,7 +72,7 @@
 
 	/*< public >*/
 	gint (*send)(PurpleProtocolIM *im, PurpleConnection *connection,
-	             PurpleMessage *msg);
+	             PurpleConversation *conversation, PurpleMessage *msg);
 
 	guint (*send_typing)(PurpleProtocolIM *im, PurpleConnection *connection,
 	                     const gchar *name, PurpleIMTypingState state);
@@ -86,6 +87,7 @@
  * purple_protocol_im_send:
  * @im: The #PurpleProtocolIM instance.
  * @connection: The #PurpleConnection to use.
+ * @conversation: The [class@Conversation] this message is for.
  * @msg: The #PurpleMessage to send.
  *
  * Sends @msg out over @connection.
@@ -95,6 +97,7 @@
  */
 gint purple_protocol_im_send(PurpleProtocolIM *im,
                              PurpleConnection *connection,
+                             PurpleConversation *conversation,
                              PurpleMessage *msg);
 
 /**
diff --git a/libpurple/purpleprotocolim.c b/libpurple/purpleprotocolim.c
--- a/libpurple/purpleprotocolim.c
+++ b/libpurple/purpleprotocolim.c
@@ -36,7 +36,7 @@
  *****************************************************************************/
 gint
 purple_protocol_im_send(PurpleProtocolIM *im, PurpleConnection *gc,
-                        PurpleMessage *msg)
+                        PurpleConversation *conversation, PurpleMessage *msg)
 {
 	PurpleProtocolIMInterface *iface = NULL;
 
@@ -44,7 +44,7 @@
 
 	iface = PURPLE_PROTOCOL_IM_GET_IFACE(im);
 	if(iface && iface->send) {
-		return iface->send(im, gc, msg);
+		return iface->send(im, gc, conversation, msg);
 	}
 
 	return -1;
diff --git a/libpurple/server.c b/libpurple/server.c
--- a/libpurple/server.c
+++ b/libpurple/server.c
@@ -86,7 +86,7 @@
 	if(PURPLE_IS_PROTOCOL_IM(protocol)) {
 		PurpleProtocolIM *pim = PURPLE_PROTOCOL_IM(protocol);
 
-		val = purple_protocol_im_send(pim, gc, msg);
+		val = purple_protocol_im_send(pim, gc, im, msg);
 	}
 
 	if(im && purple_im_conversation_get_send_typed_timeout(PURPLE_IM_CONVERSATION(im)))
