changeset 31233:22f26c372797

Manage sending messages trough switchboard in sbconn.
author masca@cpw.pidgin.im
date Tue, 15 Jun 2010 21:21:24 +0000
parents 4481d04cda70
children e545b2b6f66a
files libpurple/protocols/msn/sbconn.c libpurple/protocols/msn/sbconn.h libpurple/protocols/msn/slplink.c
diffstat 3 files changed, 20 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/sbconn.c	Tue Jun 15 21:05:27 2010 +0000
+++ b/libpurple/protocols/msn/sbconn.c	Tue Jun 15 21:21:24 2010 +0000
@@ -59,3 +59,18 @@
 	msn_message_unref(msg);
 }
 
+void msn_sbconn_send_msg(MsnSlpLink *slplink, MsnMessage *msg)
+{
+	if (slplink->swboard == NULL)
+	{
+		slplink->swboard = msn_session_get_swboard(slplink->session,
+				slplink->remote_user, MSN_SB_FLAG_FT);
+
+		g_return_if_fail(slplink->swboard != NULL);
+
+		/* If swboard is destroyed we will be too */
+		slplink->swboard->slplinks = g_list_prepend(slplink->swboard->slplinks, slplink);
+	}
+
+	msn_switchboard_send_msg(slplink->swboard, msg, TRUE);
+}
--- a/libpurple/protocols/msn/sbconn.h	Tue Jun 15 21:05:27 2010 +0000
+++ b/libpurple/protocols/msn/sbconn.h	Tue Jun 15 21:21:24 2010 +0000
@@ -2,10 +2,14 @@
 #define MSN_SBCONN_H
 
 #include "msg.h"
+#include "slplink.h"
 
 #define MSN_SBCONN_MAX_SIZE 1202
 
 void msn_sbconn_msg_ack(MsnMessage *msg, void *data);
 
 void msn_sbconn_msg_nak(MsnMessage *msg, void *data);
+
+void msn_sbconn_send_msg(MsnSlpLink *slplink, MsnMessage *msg);
+
 #endif /* MSN_SBCONN_H */
--- a/libpurple/protocols/msn/slplink.c	Tue Jun 15 21:05:27 2010 +0000
+++ b/libpurple/protocols/msn/slplink.c	Tue Jun 15 21:21:24 2010 +0000
@@ -274,18 +274,7 @@
 	}
 	else
 	{
-		if (slplink->swboard == NULL)
-		{
-			slplink->swboard = msn_session_get_swboard(slplink->session,
-													   slplink->remote_user, MSN_SB_FLAG_FT);
-
-			g_return_if_fail(slplink->swboard != NULL);
-
-			/* If swboard is destroyed we will be too */
-			slplink->swboard->slplinks = g_list_prepend(slplink->swboard->slplinks, slplink);
-		}
-
-		msn_switchboard_send_msg(slplink->swboard, msg, TRUE);
+		msn_sbconn_send_msg(slplink, msg);
 	}
 }