pidgin: 86902651: make this togglable via env rather than ...

khc at pidgin.im khc at pidgin.im
Sun Jan 11 17:36:06 EST 2009


-----------------------------------------------------------------
Revision: 86902651768595e46a7e1225a210055c92954448
Ancestor: cbb23b5f696e5a0a36d08a287f20625c713646d1
Author: khc at pidgin.im
Date: 2009-01-11T22:27:23
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/86902651768595e46a7e1225a210055c92954448

Modified files:
        libpurple/protocols/msn/msn.c libpurple/protocols/msn/soap.c

ChangeLog: 

make this togglable via env rather than #define


-------------- next part --------------
============================================================
--- libpurple/protocols/msn/msn.c	a5ea67bc8fc42fecb29491bc239e0c906d6f5d4e
+++ libpurple/protocols/msn/msn.c	c6e653d476e3806eb98f88f17b915acb1fd2d686
@@ -1343,6 +1343,7 @@ msn_set_status(PurpleAccount *account, P
 {
 	PurpleConnection *gc;
 	MsnSession *session;
+	GSList *list, *l;
 
 	gc = purple_account_get_connection(account);
 
@@ -1351,6 +1352,17 @@ msn_set_status(PurpleAccount *account, P
 		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
============================================================
--- libpurple/protocols/msn/soap.c	40430f70e32880ef814c3f116e692f4e638b7fb6
+++ libpurple/protocols/msn/soap.c	6c780dac5c26608bb814d2a783acd4e510203fd5
@@ -68,6 +68,7 @@ typedef struct _MsnSoapConnection {
 
 	GQueue *queue;
 	MsnSoapRequest *current_request;
+	gboolean unsafe_debug;
 } MsnSoapConnection;
 
 static gboolean msn_soap_connection_run(gpointer data);
@@ -79,6 +80,7 @@ msn_soap_connection_new(MsnSession *sess
 	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 @@ msn_soap_read_cb(gpointer data, gint fd,
 	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 @@ msn_soap_connection_run(gpointer data)
 			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;


More information about the Commits mailing list