diff src/protocols/msn/msn.c @ 7590:3a48ade4f510

[gaim-migrate @ 8208] The MSNSLP stuff pretty much works. I have it disabled in this commit just in case, but I should have the rest done tonight. Also, client IDs are now sent (which was part of the problem), as are the MSNObjects (the other half of the problem). committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sat, 22 Nov 2003 00:47:24 +0000
parents cb9c3b6d6de9
children 66d9440db6ec
line wrap: on
line diff
--- a/src/protocols/msn/msn.c	Fri Nov 21 18:12:55 2003 +0000
+++ b/src/protocols/msn/msn.c	Sat Nov 22 00:47:24 2003 +0000
@@ -608,16 +608,19 @@
 	MsnSession *session = gc->proto_data;
 	const char *away;
 
-	if (gc->away != NULL) {
+	if (gc->away != NULL)
+	{
 		g_free(gc->away);
 		gc->away = NULL;
 	}
 
-	if (msg != NULL) {
+	if (msg != NULL)
+	{
 		gc->away = g_strdup("");
 		away = "AWY";
 	}
-	else if (state) {
+	else if (state)
+	{
 		gc->away = g_strdup("");
 
 		if (!strcmp(state, _("Away From Computer")))
@@ -632,7 +635,8 @@
 			away = "LUN";
 		else if (!strcmp(state, _("Hidden")))
 			away = "HDN";
-		else {
+		else
+		{
 			g_free(gc->away);
 			gc->away = NULL;
 			away = "NLN";
@@ -643,10 +647,7 @@
 	else
 		away = "NLN";
 
-	if (!msn_servconn_send_command(session->notification_conn, "CHG", away)) {
-		gaim_connection_error(gc, _("Write error"));
-		return;
-	}
+	msn_session_change_status(session, away);
 }
 
 static void
@@ -657,12 +658,7 @@
 	if (gc->away != NULL)
 		return;
 
-	if (!msn_servconn_send_command(session->notification_conn, "CHG",
-								   (idle ? "IDL" : "NLN"))) {
-
-		gaim_connection_error(gc, _("Write error"));
-		return;
-	}
+	msn_session_change_status(session, (idle ? "IDL" : "NLN"));
 }
 
 static void
@@ -1234,6 +1230,17 @@
 }
 
 static void
+msn_set_buddy_icon(GaimConnection *gc, const char *filename)
+{
+	MsnSession *session = (MsnSession *)gc->proto_data;
+	MsnUser *user = session->user;
+
+	msn_user_set_buddy_icon(user, filename);
+
+	msn_session_change_status(session, session->away_state);
+}
+
+static void
 msn_remove_group(GaimConnection *gc, const char *name)
 {
 	MsnSession *session = (MsnSession *)gc->proto_data;
@@ -1605,7 +1612,7 @@
 	msn_buddy_free,
 	msn_convo_closed,
 	msn_normalize,
-	NULL,
+	msn_set_buddy_icon,
 	msn_remove_group
 };