pidgin: 3e9a3f36: Change all MSN_DEBUG_* messages to use t...
qulogic at pidgin.im
qulogic at pidgin.im
Sat Jul 11 03:05:35 EDT 2009
-----------------------------------------------------------------
Revision: 3e9a3f364e2e03052d3610d11e94c71f50fdacf5
Ancestor: a8422436d38c6888ffb8da715cd67333fe40ebe6
Author: qulogic at pidgin.im
Date: 2009-07-10T00:51:31
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/3e9a3f364e2e03052d3610d11e94c71f50fdacf5
Modified files:
libpurple/protocols/msn/httpconn.c
libpurple/protocols/msn/msg.c libpurple/protocols/msn/msn.h
libpurple/protocols/msn/notification.c
libpurple/protocols/msn/slp.c
libpurple/protocols/msn/slpcall.c
libpurple/protocols/msn/slpmsg.c
libpurple/protocols/msn/slpmsg.h
libpurple/protocols/msn/switchboard.c
ChangeLog:
Change all MSN_DEBUG_* messages to use the new purple_debug_is_verbose call
for runtime switching.
-------------- next part --------------
============================================================
--- libpurple/protocols/msn/httpconn.c 3d00fc165bbdee5697b5aa212f9353d9a913d37a
+++ libpurple/protocols/msn/httpconn.c 86006fd279cd756cf2f2646a2b33b1aecfa09117
@@ -161,10 +161,9 @@ msn_httpconn_parse_data(MsnHttpConn *htt
memcpy(body, body_start, body_len);
body[body_len] = '\0';
-#ifdef MSN_DEBUG_HTTP
- purple_debug_misc("msn", "Incoming HTTP buffer (header): {%s}\n",
- header);
-#endif
+ if (purple_debug_is_verbose())
+ purple_debug_misc("msn", "Incoming HTTP buffer (header): {%s}\n",
+ header);
/* Now we should be able to process the data. */
if ((s = purple_strcasestr(header, "X-MSN-Messenger: ")) != NULL)
============================================================
--- libpurple/protocols/msn/msg.c 7a9b02348bb364b3d8d81a0b5f14d6438329f8e3
+++ libpurple/protocols/msn/msg.c 22353c00088ed0fe16be26e0a3a52a6a11869f62
@@ -33,9 +33,8 @@ msn_message_new(MsnMsgType type)
msg = g_new0(MsnMessage, 1);
msg->type = type;
-#ifdef MSN_DEBUG_MSG
- purple_debug_info("msn", "message new (%p)(%d)\n", msg, type);
-#endif
+ if (purple_debug_is_verbose())
+ purple_debug_info("msn", "message new (%p)(%d)\n", msg, type);
msg->attr_table = g_hash_table_new_full(g_str_hash, g_str_equal,
g_free, g_free);
@@ -57,9 +56,8 @@ msn_message_destroy(MsnMessage *msg)
return;
}
-#ifdef MSN_DEBUG_MSG
- purple_debug_info("msn", "message destroy (%p)\n", msg);
-#endif
+ if (purple_debug_is_verbose())
+ purple_debug_info("msn", "message destroy (%p)\n", msg);
g_free(msg->remote_user);
g_free(msg->body);
@@ -79,9 +77,8 @@ msn_message_ref(MsnMessage *msg)
msg->ref_count++;
-#ifdef MSN_DEBUG_MSG
- purple_debug_info("msn", "message ref (%p)[%" G_GSIZE_FORMAT "]\n", msg, msg->ref_count);
-#endif
+ if (purple_debug_is_verbose())
+ purple_debug_info("msn", "message ref (%p)[%" G_GSIZE_FORMAT "]\n", msg, msg->ref_count);
return msg;
}
@@ -94,9 +91,8 @@ msn_message_unref(MsnMessage *msg)
msg->ref_count--;
-#ifdef MSN_DEBUG_MSG
- purple_debug_info("msn", "message unref (%p)[%" G_GSIZE_FORMAT "]\n", msg, msg->ref_count);
-#endif
+ if (purple_debug_is_verbose())
+ purple_debug_info("msn", "message unref (%p)[%" G_GSIZE_FORMAT "]\n", msg, msg->ref_count);
if (msg->ref_count == 0)
{
============================================================
--- libpurple/protocols/msn/msn.h 70bc9f2402084a78ed77fd0adae77f7ea338b987
+++ libpurple/protocols/msn/msn.h a0db01bb0e3cc3d91170332c436082e399162e5f
@@ -24,17 +24,6 @@
#ifndef _MSN_H_
#define _MSN_H_
-/* #define MSN_DEBUG_MSG 1 */
-/* #define MSN_DEBUG_SLPMSG 1 */
-/* #define MSN_DEBUG_HTTP 1 */
-
-/* #define MSN_DEBUG_SLP 1 */
-/* #define MSN_DEBUG_SLP_VERBOSE 1 */
-/* #define MSN_DEBUG_SLP_FILES 1 */
-
-/* #define MSN_DEBUG_NS 1 */
-/* #define MSN_DEBUG_SB 1 */
-
#include "internal.h"
#include "account.h"
============================================================
--- libpurple/protocols/msn/notification.c 0c9adbe97dc238b16f428967acf334bdfcb82108
+++ libpurple/protocols/msn/notification.c fd5c2380098900d00c777434dc955808f014e984
@@ -310,9 +310,8 @@ msg_cmd_post(MsnCmdProc *cmdproc, MsnCom
msg = msn_message_new_from_cmd(cmdproc->session, cmd);
msn_message_parse_payload(msg, payload, len, MSG_LINE_DEM, MSG_BODY_DEM);
-#ifdef MSN_DEBUG_NS
- msn_message_show_readable(msg, "Notification", TRUE);
-#endif
+ if (purple_debug_is_verbose())
+ msn_message_show_readable(msg, "Notification", TRUE);
msn_cmdproc_process_msg(cmdproc, msg);
@@ -376,9 +375,8 @@ ubm_cmd_post(MsnCmdProc *cmdproc, MsnCom
msg = msn_message_new_from_cmd(cmdproc->session, cmd);
msn_message_parse_payload(msg, payload, len,MSG_LINE_DEM,MSG_BODY_DEM);
-#ifdef MSN_DEBUG_NS
- msn_message_show_readable(msg, "Notification", TRUE);
-#endif
+ if (purple_debug_is_verbose())
+ msn_message_show_readable(msg, "Notification", TRUE);
gc = cmdproc->session->account->gc;
passport = msg->remote_user;
============================================================
--- libpurple/protocols/msn/slp.c 60edbb80644c78487730734cf0785f45d171d9fc
+++ libpurple/protocols/msn/slp.c 729890fdb8e2a4ec2fe7ead5016b917a969bc793
@@ -34,8 +34,6 @@
/* ms to delay between sending buddy icon requests to the server. */
#define BUDDY_ICON_DELAY 20
-/*debug SLP*/
-#define MSN_DEBUG_UD
static void send_ok(MsnSlpCall *slpcall, const char *branch,
const char *type, const char *content);
@@ -212,10 +210,8 @@ send_ok(MsnSlpCall *slpcall, const char
"MSNSLP/1.0 200 OK",
branch, type, content);
-#ifdef MSN_DEBUG_SLP
slpmsg->info = "SLP 200 OK";
slpmsg->text_body = TRUE;
-#endif
msn_slplink_queue_slpmsg(slplink, slpmsg);
@@ -236,10 +232,8 @@ send_decline(MsnSlpCall *slpcall, const
"MSNSLP/1.0 603 Decline",
branch, type, content);
-#ifdef MSN_DEBUG_SLP
slpmsg->info = "SLP 603 Decline";
slpmsg->text_body = TRUE;
-#endif
msn_slplink_queue_slpmsg(slplink, slpmsg);
}
@@ -309,18 +303,14 @@ got_sessionreq(MsnSlpCall *slpcall, cons
slpmsg->slpcall = slpcall;
slpmsg->session_id = slpcall->session_id;
msn_slpmsg_set_body(slpmsg, NULL, 4);
-#ifdef MSN_DEBUG_SLP
slpmsg->info = "SLP DATA PREP";
-#endif
msn_slplink_queue_slpmsg(slplink, slpmsg);
/* DATA */
slpmsg = msn_slpmsg_new(slplink);
slpmsg->slpcall = slpcall;
slpmsg->flags = 0x20;
-#ifdef MSN_DEBUG_SLP
slpmsg->info = "SLP DATA";
-#endif
msn_slpmsg_set_image(slpmsg, img);
msn_slplink_queue_slpmsg(slplink, slpmsg);
purple_imgstore_unref(img);
@@ -448,10 +438,8 @@ send_bye(MsnSlpCall *slpcall, const char
"\r\n");
g_free(header);
-#ifdef MSN_DEBUG_SLP
slpmsg->info = "SLP BYE";
slpmsg->text_body = TRUE;
-#endif
msn_slplink_queue_slpmsg(slplink, slpmsg);
}
@@ -619,10 +607,8 @@ got_ok(MsnSlpCall *slpcall,
"application/x-msnmsgr-transreqbody",
content);
-#ifdef MSN_DEBUG_SLP
slpmsg->info = "SLP INVITE";
slpmsg->text_body = TRUE;
-#endif
msn_slplink_send_slpmsg(slplink, slpmsg);
g_free(header);
@@ -839,9 +825,8 @@ got_emoticon(MsnSlpCall *slpcall,
purple_conv_custom_smiley_write(conv, slpcall->data_info, data, size);
purple_conv_custom_smiley_close(conv, slpcall->data_info );
}
-#ifdef MSN_DEBUG_UD
- purple_debug_info("msn", "Got smiley: %s\n", slpcall->data_info);
-#endif
+ if (purple_debug_is_verbose())
+ purple_debug_info("msn", "Got smiley: %s\n", slpcall->data_info);
}
void
@@ -963,9 +948,8 @@ msn_release_buddy_icon_request(MsnUserLi
g_return_if_fail(userlist != NULL);
-#ifdef MSN_DEBUG_UD
- purple_debug_info("msn", "Releasing buddy icon request\n");
-#endif
+ if (purple_debug_is_verbose())
+ purple_debug_info("msn", "Releasing buddy icon request\n");
if (userlist->buddy_icon_window > 0)
{
@@ -986,10 +970,10 @@ msn_release_buddy_icon_request(MsnUserLi
userlist->buddy_icon_window--;
request_user_display(user);
-#ifdef MSN_DEBUG_UD
- purple_debug_info("msn", "msn_release_buddy_icon_request(): buddy_icon_window-- yields =%d\n",
- userlist->buddy_icon_window);
-#endif
+ if (purple_debug_is_verbose())
+ purple_debug_info("msn",
+ "msn_release_buddy_icon_request(): buddy_icon_window-- yields =%d\n",
+ userlist->buddy_icon_window);
}
}
@@ -1039,10 +1023,9 @@ msn_queue_buddy_icon_request(MsnUser *us
userlist = user->userlist;
queue = userlist->buddy_icon_requests;
-#ifdef MSN_DEBUG_UD
- purple_debug_info("msn", "Queueing buddy icon request for %s (buddy_icon_window = %i)\n",
- user->passport, userlist->buddy_icon_window);
-#endif
+ if (purple_debug_is_verbose())
+ purple_debug_info("msn", "Queueing buddy icon request for %s (buddy_icon_window = %i)\n",
+ user->passport, userlist->buddy_icon_window);
g_queue_push_tail(queue, user);
@@ -1062,9 +1045,8 @@ got_user_display(MsnSlpCall *slpcall,
g_return_if_fail(slpcall != NULL);
info = slpcall->data_info;
-#ifdef MSN_DEBUG_UD
- purple_debug_info("msn", "Got User Display: %s\n", slpcall->slplink->remote_user);
-#endif
+ if (purple_debug_is_verbose())
+ purple_debug_info("msn", "Got User Display: %s\n", slpcall->slplink->remote_user);
userlist = slpcall->slplink->session->userlist;
account = slpcall->slplink->session->account;
@@ -1090,9 +1072,8 @@ end_user_display(MsnSlpCall *slpcall, Ms
g_return_if_fail(session != NULL);
-#ifdef MSN_DEBUG_UD
- purple_debug_info("msn", "End User Display\n");
-#endif
+ if (purple_debug_is_verbose())
+ purple_debug_info("msn", "End User Display\n");
userlist = session->userlist;
@@ -1150,9 +1131,8 @@ request_user_display(MsnUser *user)
gconstpointer data = NULL;
size_t len = 0;
-#ifdef MSN_DEBUG_UD
- purple_debug_info("msn", "Requesting our own user display\n");
-#endif
+ if (purple_debug_is_verbose())
+ purple_debug_info("msn", "Requesting our own user display\n");
my_obj = msn_user_get_object(session->user);
@@ -1168,10 +1148,9 @@ request_user_display(MsnUser *user)
/* Free one window slot */
session->userlist->buddy_icon_window++;
-#ifdef MSN_DEBUG_UD
- purple_debug_info("msn", "request_user_display(): buddy_icon_window++ yields =%d\n",
- session->userlist->buddy_icon_window);
-#endif
+ if (purple_debug_is_verbose())
+ purple_debug_info("msn", "request_user_display(): buddy_icon_window++ yields =%d\n",
+ session->userlist->buddy_icon_window);
msn_release_buddy_icon_request(session->userlist);
}
============================================================
--- libpurple/protocols/msn/slpcall.c ab3ce844232f80ec3f8ccd00a1273458d0cbf30d
+++ libpurple/protocols/msn/slpcall.c b0e9b07b1c4bf797fc2fe77b2cc2f961544e9b4d
@@ -27,8 +27,6 @@
#include "slp.h"
-/* #define MSN_DEBUG_SLPCALL */
-
/**************************************************************************
* Main
**************************************************************************/
@@ -40,9 +38,8 @@ msn_slpcall_timeout(gpointer data)
slpcall = data;
-#ifdef MSN_DEBUG_SLPCALL
- purple_debug_info("msn", "slpcall_timeout: slpcall(%p)\n", slpcall);
-#endif
+ if (purple_debug_is_verbose())
+ purple_debug_info("msn", "slpcall_timeout: slpcall(%p)\n", slpcall);
if (!slpcall->pending && !slpcall->progress)
{
@@ -64,9 +61,8 @@ msn_slpcall_new(MsnSlpLink *slplink)
slpcall = g_new0(MsnSlpCall, 1);
-#ifdef MSN_DEBUG_SLPCALL
- purple_debug_info("msn", "slpcall_new: slpcall(%p)\n", slpcall);
-#endif
+ if (purple_debug_is_verbose())
+ purple_debug_info("msn", "slpcall_new: slpcall(%p)\n", slpcall);
slpcall->slplink = slplink;
@@ -82,9 +78,8 @@ msn_slpcall_destroy(MsnSlpCall *slpcall)
{
GList *e;
-#ifdef MSN_DEBUG_SLPCALL
- purple_debug_info("msn", "slpcall_destroy: slpcall(%p)\n", slpcall);
-#endif
+ if (purple_debug_is_verbose())
+ purple_debug_info("msn", "slpcall_destroy: slpcall(%p)\n", slpcall);
g_return_if_fail(slpcall != NULL);
@@ -96,10 +91,9 @@ msn_slpcall_destroy(MsnSlpCall *slpcall)
MsnSlpMessage *slpmsg = e->data;
e = e->next;
-#ifdef MSN_DEBUG_SLPCALL_VERBOSE
- purple_debug_info("msn", "slpcall_destroy: trying slpmsg(%p)\n",
- slpmsg);
-#endif
+ if (purple_debug_is_verbose())
+ purple_debug_info("msn", "slpcall_destroy: trying slpmsg(%p)\n",
+ slpmsg);
if (slpmsg->slpcall == slpcall)
{
@@ -173,10 +167,8 @@ msn_slpcall_invite(MsnSlpCall *slpcall,
slpmsg = msn_slpmsg_sip_new(slpcall, 0, header, slpcall->branch,
"application/x-msnmsgr-sessionreqbody", content);
-#ifdef MSN_DEBUG_SLP
slpmsg->info = "SLP INVITE";
slpmsg->text_body = TRUE;
-#endif
msn_slplink_send_slpmsg(slplink, slpmsg);
============================================================
--- libpurple/protocols/msn/slpmsg.c 4079fc69f7eed12ff341c63d8dc83548d820c63a
+++ libpurple/protocols/msn/slpmsg.c 8ee2dfefc6713b5b3a639f6a1056a89d23364850
@@ -36,9 +36,8 @@ msn_slpmsg_new(MsnSlpLink *slplink)
slpmsg = g_new0(MsnSlpMessage, 1);
-#ifdef MSN_DEBUG_SLPMSG
- purple_debug_info("msn", "slpmsg new (%p)\n", slpmsg);
-#endif
+ if (purple_debug_is_verbose())
+ purple_debug_info("msn", "slpmsg new (%p)\n", slpmsg);
slpmsg->slplink = slplink;
@@ -56,9 +55,8 @@ msn_slpmsg_destroy(MsnSlpMessage *slpmsg
g_return_if_fail(slpmsg != NULL);
-#ifdef MSN_DEBUG_SLPMSG
- purple_debug_info("msn", "slpmsg destroy (%p)\n", slpmsg);
-#endif
+ if (purple_debug_is_verbose())
+ purple_debug_info("msn", "slpmsg destroy (%p)\n", slpmsg);
slplink = slpmsg->slplink;
@@ -72,13 +70,6 @@ msn_slpmsg_destroy(MsnSlpMessage *slpmsg
if (slpmsg->img == NULL)
g_free(slpmsg->buffer);
-#ifdef MSN_DEBUG_SLP
- /*
- if (slpmsg->info != NULL)
- g_free(slpmsg->info);
- */
-#endif
-
for (cur = slpmsg->msgs; cur != NULL; cur = cur->next)
{
/* Something is pointing to this slpmsg, so we should remove that
@@ -87,10 +78,6 @@ msn_slpmsg_destroy(MsnSlpMessage *slpmsg
MsnMessage *msg = cur->data;
-#ifdef MSN_DEBUG_SLPMSG
- purple_debug_info("msn", "Unlink slpmsg callbacks.\n");
-#endif
-
msg->ack_cb = NULL;
msg->nak_cb = NULL;
msg->ack_data = NULL;
@@ -132,7 +119,6 @@ msn_slpmsg_set_image(MsnSlpMessage *slpm
slpmsg->size = purple_imgstore_get_size(img);
}
-#ifdef MSN_DEBUG_SLP
void
msn_slpmsg_show(MsnMessage *msg)
{
@@ -161,7 +147,6 @@ msn_slpmsg_show(MsnMessage *msg)
msn_message_show_readable(msg, info, text);
}
-#endif
MsnSlpMessage *
msn_slpmsg_sip_new(MsnSlpCall *slpcall, int cseq,
============================================================
--- libpurple/protocols/msn/slpmsg.h 089bc3c61f92bbccb87608deedafb52ab43898b5
+++ libpurple/protocols/msn/slpmsg.h e76be5e2eb050cd25f09534827822efcf194fc56
@@ -68,10 +68,8 @@ struct _MsnSlpMessage
MsnMessage *msg; /**< The temporary real message that will be sent. */
#endif
-#ifdef MSN_DEBUG_SLP
- char *info;
+ const char *info;
gboolean text_body;
-#endif
};
/**
@@ -100,8 +98,6 @@ MsnSlpMessage * msn_slpmsg_sip_new(MsnSl
const char *content_type,
const char *content);
-#ifdef MSN_DEBUG_SLP
void msn_slpmsg_show(MsnMessage *msg);
-#endif
#endif /* _MSN_SLPMSG_H_ */
============================================================
--- libpurple/protocols/msn/switchboard.c 77420c03da4390269d556a13cc9df0904c996eb4
+++ libpurple/protocols/msn/switchboard.c a9a7ce992850f83f303ada60f8a41d027f47f6d8
@@ -60,6 +60,9 @@ msn_switchboard_new(MsnSession *session)
session->switches = g_list_prepend(session->switches, swboard);
+ if (purple_debug_is_verbose())
+ purple_debug_info("msn", "switchboard new: swboard(%p)\n", swboard);
+
return swboard;
}
@@ -70,9 +73,8 @@ msn_switchboard_destroy(MsnSwitchBoard *
MsnMessage *msg;
GList *l;
-#ifdef MSN_DEBUG_SB
- purple_debug_info("msn", "switchboard_destroy: swboard(%p)\n", swboard);
-#endif
+ if (purple_debug_is_verbose())
+ purple_debug_info("msn", "switchboard destroy: swboard(%p)\n", swboard);
g_return_if_fail(swboard != NULL);
@@ -230,10 +232,9 @@ msn_switchboard_add_user(MsnSwitchBoard
swboard->current_users++;
swboard->empty = FALSE;
-#ifdef MSN_DEBUG_CHAT
- purple_debug_info("msn", "user=[%s], total=%d\n", user,
- swboard->current_users);
-#endif
+ if (purple_debug_is_verbose())
+ purple_debug_info("msn", "user=[%s], total=%d\n",
+ user, swboard->current_users);
if (!(swboard->flag & MSN_SB_FLAG_IM) && (swboard->conv != NULL))
{
@@ -255,10 +256,6 @@ msn_switchboard_add_user(MsnSwitchBoard
{
GList *l;
-#ifdef MSN_DEBUG_CHAT
- purple_debug_info("msn", "[chat] Switching to chat.\n");
-#endif
-
#if 0
/* this is bad - it causes msn_switchboard_close to be called on the
* switchboard we're in the middle of using :( */
@@ -278,18 +275,10 @@ msn_switchboard_add_user(MsnSwitchBoard
tmp_user = l->data;
-#ifdef MSN_DEBUG_CHAT
- purple_debug_info("msn", "[chat] Adding [%s].\n", tmp_user);
-#endif
-
purple_conv_chat_add_user(PURPLE_CONV_CHAT(swboard->conv),
tmp_user, NULL, PURPLE_CBFLAGS_NONE, TRUE);
}
-#ifdef MSN_DEBUG_CHAT
- purple_debug_info("msn", "[chat] We add ourselves.\n");
-#endif
-
purple_conv_chat_add_user(PURPLE_CONV_CHAT(swboard->conv),
purple_account_get_username(account),
NULL, PURPLE_CBFLAGS_NONE, TRUE);
@@ -589,10 +578,10 @@ release_msg(MsnSwitchBoard *swboard, Msn
payload = msn_message_gen_payload(msg, &payload_len);
-#ifdef MSN_DEBUG_SB
- purple_debug_info("msn", "SB length:{%" G_GSIZE_FORMAT "}\n", payload_len);
- msn_message_show_readable(msg, "SB SEND", FALSE);
-#endif
+ if (purple_debug_is_verbose()) {
+ purple_debug_info("msn", "SB length:{%" G_GSIZE_FORMAT "}\n", payload_len);
+ msn_message_show_readable(msg, "SB SEND", FALSE);
+ }
flag = msn_message_get_flag(msg);
trans = msn_transaction_new(cmdproc, "MSG", "%c %" G_GSIZE_FORMAT,
@@ -790,9 +779,8 @@ msg_cmd_post(MsnCmdProc *cmdproc, MsnCom
msn_message_parse_payload(msg, payload, len,
MSG_LINE_DEM,MSG_BODY_DEM);
-#ifdef MSN_DEBUG_SB
- msn_message_show_readable(msg, "SB RECV", FALSE);
-#endif
+ if (purple_debug_is_verbose())
+ msn_message_show_readable(msg, "SB RECV", FALSE);
g_free (msg->remote_user);
msg->remote_user = g_strdup(cmd->params[0]);
More information about the Commits
mailing list