pidgin: 5c6eda38: Remove a bunch of calls to msim_msg_dump...

markdoliner at pidgin.im markdoliner at pidgin.im
Tue Dec 16 19:00:55 EST 2008


-----------------------------------------------------------------
Revision: 5c6eda3812ca95919c40aced43b3fe297b870783
Ancestor: 5e5c83f0df1b90822ca4be016dd65eb254ad28c7
Author: markdoliner at pidgin.im
Date: 2008-12-16T21:31:05
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/5c6eda3812ca95919c40aced43b3fe297b870783

Modified files:
        libpurple/protocols/myspace/message.c
        libpurple/protocols/myspace/myspace.c
        libpurple/protocols/myspace/myspace.h
        libpurple/protocols/myspace/user.c

ChangeLog: 

Remove a bunch of calls to msim_msg_dump().  I find it really annoying
that incoming messages get printed multiple times.  The entire thing
is printed in msim_parse(), so why would we want to print it anywhere
else?

-------------- next part --------------
============================================================
--- libpurple/protocols/myspace/message.c	0cfccdf0960db2dd55ddf6d9b9b290af6b994749
+++ libpurple/protocols/myspace/message.c	ce5e0ead3a3a8962b620a92a7ff0c5116bba1076
@@ -715,10 +715,6 @@ msim_msg_free(MsimMessage *msg)
 		return;
 	}
 
-#ifdef MSIM_MSG_DEBUG_FREE
-	msim_msg_dump("msim_msg_free: freeing %s", msg);
-#endif
-
 	g_list_foreach(msg, msim_msg_free_element, NULL);
 	g_list_free(msg);
 }
@@ -872,8 +868,6 @@ msim_msg_send(MsimSession *session, Msim
 	success = msim_send_raw(session, raw);
 	g_free(raw);
 
-	msim_msg_dump("msim_msg_send()ing %s\n", msg);
-
 	return success;
 }
 
============================================================
--- libpurple/protocols/myspace/myspace.c	f0b80cabaf054d7ca691ac0535303429773c0a38
+++ libpurple/protocols/myspace/myspace.c	b9a6dd2f4b1a1deec45f06f709c29c1565d8d458
@@ -60,7 +60,6 @@ msim_do_postprocessing(MsimMessage *msg,
 		const gchar *uid_field_name, guint uid)
 {
 	MsimMessageElement *elem;
-	msim_msg_dump("msim_do_postprocessing msg: %s\n", msg);
 
 	/* First, check - if the field already exists, replace <uid> within it */
 	if ((elem = msim_msg_get(msg, uid_field_name)) != NULL) {
@@ -95,8 +94,6 @@ msim_do_postprocessing(MsimMessage *msg,
 		msg = msim_msg_insert_before(msg, uid_before, uid_field_name, MSIM_TYPE_INTEGER, GUINT_TO_POINTER(uid));
 	}
 
-	msim_msg_dump("msim_postprocess_outgoing_cb: postprocessed msg=%s\n", msg);
-
 	return msg;
 }
 
@@ -122,8 +119,6 @@ msim_postprocess_outgoing_cb(MsimSession
 
 	msg = (MsimMessage *)data;
 
-	msim_msg_dump("msim_postprocess_outgoing_cb() got msg=%s\n", msg);
-
 	/* Obtain userid from userinfo message. */
 	body = msim_msg_get_dictionary(userinfo, "body");
 	g_return_if_fail(body != NULL);
@@ -194,7 +189,6 @@ msim_postprocess_outgoing(MsimSession *s
 	g_return_val_if_fail(msg != NULL, FALSE);
 
 	/* Store information for msim_postprocess_outgoing_cb(). */
-	msim_msg_dump("msim_postprocess_outgoing: msg before=%s\n", msg);
 	msg = msim_msg_append(msg, "_username", MSIM_TYPE_STRING, g_strdup(username));
 	msg = msim_msg_append(msg, "_uid_field_name", MSIM_TYPE_STRING, g_strdup(uid_field_name));
 	msg = msim_msg_append(msg, "_uid_before", MSIM_TYPE_STRING, g_strdup(uid_before));
@@ -215,7 +209,6 @@ msim_postprocess_outgoing(MsimSession *s
 			/* Don't have uid offhand - need to ask for it, and wait until hear back before sending. */
 			purple_debug_info("msim", ">>> msim_postprocess_outgoing: couldn't find username %s in blist\n",
 					username ? username : "(NULL)");
-			msim_msg_dump("msim_postprocess_outgoing - scheduling lookup, msg=%s\n", msg);
 			/* TODO: where is cloned message freed? Should be in _cb. */
 			msim_lookup_user(session, username, msim_postprocess_outgoing_cb, msim_msg_clone(msg));
 			return TRUE;       /* not sure of status yet - haven't sent! */
@@ -228,8 +221,6 @@ msim_postprocess_outgoing(MsimSession *s
 
 	msg = msim_do_postprocessing(msg, uid_before, uid_field_name, uid);
 
-	msim_msg_dump("msim_postprocess_outgoing: msg after (uid immediate)=%s\n", msg);
-
 	rc = msim_msg_send(session, msg);
 
 	/* TODO: free
@@ -867,8 +858,6 @@ msim_check_inbox_cb(MsimSession *session
 
 	g_return_if_fail(reply != NULL);
 
-	msim_msg_dump("msim_check_inbox_cb: reply=%s\n", reply);
-
 	body = msim_msg_get_dictionary(reply, "body");
 
 	if (body == NULL)
@@ -1081,8 +1070,6 @@ msim_got_contact_list(MsimSession *sessi
 	gchar *msg;
 	guint buddy_count;
 
-	msim_msg_dump("msim_got_contact_list: reply=%s", reply);
-
 	body = msim_msg_get_dictionary(reply, "body");
 	if (!body) {
 		/* No friends. Not an error. */
@@ -1311,8 +1298,6 @@ msim_incoming_status(MsimSession *sessio
 	g_return_val_if_fail(MSIM_SESSION_VALID(session), FALSE);
 	g_return_val_if_fail(msg != NULL, FALSE);
 
-	msim_msg_dump("msim_status msg=%s\n", msg);
-
 	/* Helpfully looked up by msim_incoming_resolve() for us. */
 	username = msim_msg_get_string(msg, "_username");
 	g_return_val_if_fail(username != NULL, FALSE);
@@ -1750,7 +1735,6 @@ msim_process_reply(MsimSession *session,
 
 	if (cb) {
 		purple_debug_info("msim", "msim_process_reply: calling callback now\n");
-		msim_msg_dump("for msg=%s\n", msg);
 		/* Clone message, so that the callback 'cb' can use it (needs to free it also). */
 		cb(session, msim_msg_clone(msg), data);
 		g_hash_table_remove(session->user_lookup_cb, GUINT_TO_POINTER(rid));
@@ -1850,10 +1834,6 @@ msim_process(MsimSession *session, MsimM
 	g_return_val_if_fail(session != NULL, FALSE);
 	g_return_val_if_fail(msg != NULL, FALSE);
 
-#ifdef MSIM_DEBUG_MSG
-	msim_msg_dump("ready to process: %s\n", msg);
-#endif
-
 	if (msim_msg_get_integer(msg, "lc") == 1) {
 		return msim_login_challenge(session, msg);
 	} else if (msim_msg_get_integer(msg, "lc") == 2) {
@@ -2782,6 +2762,10 @@ msim_offline_message(const PurpleBuddy *
  *
  * @return Bytes successfully sent, or -1 on error.
  */
+/*
+ * TODO: This needs to do non-blocking writes and use a watcher to check
+  *      when the fd is available to be written to.
+ */
 static int
 msim_send_really_raw(PurpleConnection *gc, const char *buf, int total_bytes)
 {
@@ -2956,7 +2940,6 @@ msim_import_friends_cb(MsimSession *sess
 {
 	MsimMessage *body;
 	gchar *completed;
-	msim_msg_dump("msim_import_friends_cb=%s", reply);
 
 	/* Check if the friends were imported successfully. */
 	body = msim_msg_get_dictionary(reply, "body");
@@ -3445,16 +3428,6 @@ msim_uri_handler(const gchar *proto, con
 	return FALSE;
 }
 
-#ifdef MSIM_DEBUG_MSG
-static void
-print_hash_item(gpointer key, gpointer value, gpointer user_data)
-{
-	purple_debug_info("msim", "%s=%s\n",
-			key ? (gchar *)key : "(NULL)",
-			value ? (gchar *)value : "(NULL)");
-}
-#endif
-
 /**
  * Initialize plugin.
  */
============================================================
--- libpurple/protocols/myspace/myspace.h	998a426c3c6d02381859ac03f8d608aa61f42a62
+++ libpurple/protocols/myspace/myspace.h	578f4250226fe37a0fcc8f5efea159be88658e8e
@@ -63,7 +63,6 @@
 /*#define MSIM_SEND_CLIENT_VERSION              */
 
 /* Debugging options */
-/*#define MSIM_DEBUG_MSG                */
 /* Low-level and rarely needed */
 /*#define MSIM_DEBUG_PARSE             */
 /*#define MSIM_DEBUG_LOGIN_CHALLENGE*/
============================================================
--- libpurple/protocols/myspace/user.c	34c2cc19e2337d613fba25a116611f74ea0bbca9
+++ libpurple/protocols/myspace/user.c	7bd8a13f50c595caf7b9f64a89090eb1a4934aa9
@@ -532,8 +532,6 @@ msim_lookup_user(MsimSession *session, c
 	purple_debug_info("msim", "msim_lookup_userid: "
 			"asynchronously looking up <%s>\n", user);
 
-	msim_msg_dump("msim_lookup_user: data=%s\n", (MsimMessage *)data);
-
 	/* Setup callback. Response will be associated with request using 'rid'. */
 	rid = msim_new_reply_callback(session, cb, data);
 
@@ -587,7 +585,6 @@ static void msim_username_is_set_cb(Msim
 
 	g_return_if_fail(MSIM_SESSION_VALID(session));
 
-	msim_msg_dump("username_is_set message is: %s\n", userinfo);
 	cmd = msim_msg_get_integer(userinfo, "cmd");
 	dsn = msim_msg_get_integer(userinfo, "dsn");
 	uid = msim_msg_get_integer(userinfo, "uid");
@@ -675,8 +672,6 @@ msim_set_username(MsimSession *session, 
 	purple_debug_info("msim", "msim_set_username: "
 			"Setting username %s\n", username);
 
-	msim_msg_dump("msim_set_username: data=%s\n", (MsimMessage *)data);
-
 	/* Setup callback. Response will be associated with request using 'rid'. */
 	rid = msim_new_reply_callback(session, cb, data);
 


More information about the Commits mailing list