changeset 24333:c6c714b7841d

Get rid of slplink->local_user because it's a copy of msn_user_get_passport(session->user), which is the same as account->username, which is stupid
author Mark Doliner <mark@kingant.net>
date Thu, 13 Nov 2008 06:18:53 +0000
parents 2b62300d2c19
children d402644d0f98
files libpurple/protocols/msn/slp.c libpurple/protocols/msn/slplink.c libpurple/protocols/msn/slplink.h libpurple/protocols/msn/slpmsg.c
diffstat 4 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/slp.c	Wed Nov 12 11:30:51 2008 +0000
+++ b/libpurple/protocols/msn/slp.c	Thu Nov 13 06:18:53 2008 +0000
@@ -385,6 +385,7 @@
 send_bye(MsnSlpCall *slpcall, const char *type)
 {
 	MsnSlpLink *slplink;
+	PurpleAccount *account;
 	MsnSlpMessage *slpmsg;
 	char *header;
 
@@ -392,8 +393,10 @@
 
 	g_return_if_fail(slplink != NULL);
 
+	account = slplink->session->account;
+
 	header = g_strdup_printf("BYE MSNMSGR:%s MSNSLP/1.0",
-							 slplink->local_user);
+							 purple_account_get_username(account));
 
 	slpmsg = msn_slpmsg_sip_new(slpcall, 0, header,
 								"A0D624A6-6C0C-4283-A9E0-BC97B4B46D32",
@@ -841,6 +844,7 @@
 		sha1 = msn_object_get_sha1(obj);
 
 		slplink = msn_session_get_slplink(session, who);
+		g_assert(slplink->swboard != NULL);
 		slplink->swboard = swboard;
 
 		/* If the conversation doesn't exist then this is a custom smiley
--- a/libpurple/protocols/msn/slplink.c	Wed Nov 12 11:30:51 2008 +0000
+++ b/libpurple/protocols/msn/slplink.c	Thu Nov 13 06:18:53 2008 +0000
@@ -74,7 +74,6 @@
 	slplink->session = session;
 	slplink->slp_seq_id = rand() % 0xFFFFFF00 + 4;
 
-	slplink->local_user = g_strdup(msn_user_get_passport(session->user));
 	slplink->remote_user = g_strdup(username);
 
 	slplink->slp_msg_queue = g_queue_new();
@@ -114,7 +113,6 @@
 	session->slplinks =
 		g_list_remove(session->slplinks, slplink);
 
-	g_free(slplink->local_user);
 	g_free(slplink->remote_user);
 
 	g_free(slplink);
--- a/libpurple/protocols/msn/slplink.h	Wed Nov 12 11:30:51 2008 +0000
+++ b/libpurple/protocols/msn/slplink.h	Thu Nov 13 06:18:53 2008 +0000
@@ -45,7 +45,6 @@
 	MsnSession *session;
 	MsnSwitchBoard *swboard;
 
-	char *local_user;
 	char *remote_user;
 
 	int slp_seq_id;
--- a/libpurple/protocols/msn/slpmsg.c	Wed Nov 12 11:30:51 2008 +0000
+++ b/libpurple/protocols/msn/slpmsg.c	Thu Nov 13 06:18:53 2008 +0000
@@ -169,6 +169,7 @@
 				   const char *content_type, const char *content)
 {
 	MsnSlpLink *slplink;
+	PurpleAccount *account;
 	MsnSlpMessage *slpmsg;
 	char *body;
 	gsize body_len;
@@ -178,6 +179,7 @@
 	g_return_val_if_fail(header  != NULL, NULL);
 
 	slplink = slpcall->slplink;
+	account = slplink->session->account;
 
 	/* Let's remember that "content" should end with a 0x00 */
 
@@ -196,7 +198,7 @@
 		"\r\n",
 		header,
 		slplink->remote_user,
-		slplink->local_user,
+		purple_account_get_username(account),
 		branch,
 		cseq,
 		slpcall->id,