changeset 25306:7d6866244106

make this togglable via env rather than #define
author Ka-Hing Cheung <khc@hxbc.us>
date Sun, 11 Jan 2009 22:27:23 +0000
parents a67ac9a3fd05
children 1eedb375c937
files libpurple/protocols/msn/msn.c libpurple/protocols/msn/soap.c
diffstat 2 files changed, 19 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/msn.c	Sun Jan 11 22:03:34 2009 +0000
+++ b/libpurple/protocols/msn/msn.c	Sun Jan 11 22:27:23 2009 +0000
@@ -1343,6 +1343,7 @@
 {
 	PurpleConnection *gc;
 	MsnSession *session;
+	GSList *list, *l;
 
 	gc = purple_account_get_connection(account);
 
@@ -1351,6 +1352,17 @@
 		session = gc->proto_data;
 		msn_change_status(session);
 	}
+
+	/* fake it to ourselves */
+	if((list = purple_find_buddies(account,
+				purple_account_get_username(account))) == NULL)
+		return;
+
+	for(l = list; l != NULL; l = l->next) {
+		purple_blist_update_buddy_status(l->data, status);
+	}
+
+	g_slist_free(list);
 }
 
 static void
--- a/libpurple/protocols/msn/soap.c	Sun Jan 11 22:03:34 2009 +0000
+++ b/libpurple/protocols/msn/soap.c	Sun Jan 11 22:27:23 2009 +0000
@@ -68,6 +68,7 @@
 
 	GQueue *queue;
 	MsnSoapRequest *current_request;
+	gboolean unsafe_debug;
 } MsnSoapConnection;
 
 static gboolean msn_soap_connection_run(gpointer data);
@@ -79,6 +80,7 @@
 	conn->session = session;
 	conn->host = g_strdup(host);
 	conn->queue = g_queue_new();
+	conn->unsafe_debug = g_getenv("PURPLE_MSN_UNSAFE_DEBUG") != NULL;
 	return conn;
 }
 
@@ -504,12 +506,10 @@
 	if (cnt < 0 && perrno != EAGAIN)
 		purple_debug_info("soap", "read: %s\n", g_strerror(perrno));
 
-#ifndef MSN_UNSAFE_DEBUG
-	if (conn->current_request && conn->current_request->secure)
+	if (conn->current_request && conn->current_request->secure &&
+		!conn->unsafe_debug)
 		purple_debug_misc("soap", "Received secure request.\n");
-	else
-#endif
-	if (count != 0)
+	else if (count != 0)
 		purple_debug_misc("soap", "current %s\n", conn->buf->str + cursor);
 
 	/* && count is necessary for Adium, on OS X the last read always
@@ -657,12 +657,10 @@
 			g_string_append(conn->buf, "\r\n");
 			g_string_append(conn->buf, body);
 
-#ifndef MSN_UNSAFE_DEBUG
-			if (req->secure)
+			if (req->secure && !conn->unsafe_debug)
 				purple_debug_misc("soap", "Sending secure request.\n");
 			else
-#endif
-			purple_debug_misc("soap", "%s\n", conn->buf->str);
+				purple_debug_misc("soap", "%s\n", conn->buf->str);
 
 			conn->handled_len = 0;
 			conn->current_request = req;