When receiving an MSN custom smiley, look at the switchboard for the cpw.qulogic.msn

Sun, 29 Jun 2008 19:17:26 +0000

author
Elliott Sales de Andrade <qulogic@pidgin.im>
date
Sun, 29 Jun 2008 19:17:26 +0000
branch
cpw.qulogic.msn
changeset 23823
1e46336536b3
parent 23822
7c6240967429
child 23824
6dc2d641cfae

When receiving an MSN custom smiley, look at the switchboard for the
PurpleConversation, instead of searching for it. This should make
receiving a smiley in a chat go to the chat window, instead of opening a
new conversation with the buddy.

References #3264.

libpurple/protocols/msn/slp.c file | annotate | diff | comparison | revisions
--- a/libpurple/protocols/msn/slp.c	Sat Jun 28 08:08:22 2008 +0000
+++ b/libpurple/protocols/msn/slp.c	Sun Jun 29 19:17:26 2008 +0000
@@ -782,16 +782,13 @@
 got_emoticon(MsnSlpCall *slpcall,
 			 const guchar *data, gsize size)
 {
-
 	PurpleConversation *conv;
-	PurpleConnection *gc;
-	const char *who;
+	MsnSwitchBoard *swboard;
 
-	gc = slpcall->slplink->session->account->gc;
-	who = slpcall->slplink->remote_user;
+	swboard = slpcall->slplink->swboard;
+	conv = swboard->conv;
 
-	if ((conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_ANY, who, gc->account))) {
-
+	if (conv) {
 		/* FIXME: it would be better if we wrote the data as we received it
 		   instead of all at once, calling write multiple times and
 		   close once at the very end
@@ -809,6 +806,7 @@
 {
 	MsnSession *session;
 	MsnSlpLink *slplink;
+	MsnSwitchBoard *swboard;
 	MsnObject *obj;
 	char **tokens;
 	char *smile, *body_str;
@@ -848,8 +846,9 @@
 
 		slplink = msn_session_get_slplink(session, who);
 
-		conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_ANY, who,
-												   session->account);
+		swboard = cmdproc->data;
+		slplink->swboard = swboard;
+		conv = swboard->conv;
 
 		/* If the conversation doesn't exist then this is a custom smiley
 		 * used in the first message in a MSN conversation: we need to create

mercurial