Mercurial > pidgin.yaz
comparison libpurple/protocols/msn/msg.c @ 27509:35b6fd563056
Change all MSN_DEBUG_* messages to use the new purple_debug_is_verbose call
for runtime switching.
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Fri, 10 Jul 2009 00:51:31 +0000 |
parents | 9c413bda20be |
children | 3dcc42d3cc12 15cde23b43bc |
comparison
equal
deleted
inserted
replaced
27508:9c413bda20be | 27509:35b6fd563056 |
---|---|
31 MsnMessage *msg; | 31 MsnMessage *msg; |
32 | 32 |
33 msg = g_new0(MsnMessage, 1); | 33 msg = g_new0(MsnMessage, 1); |
34 msg->type = type; | 34 msg->type = type; |
35 | 35 |
36 #ifdef MSN_DEBUG_MSG | 36 if (purple_debug_is_verbose()) |
37 purple_debug_info("msn", "message new (%p)(%d)\n", msg, type); | 37 purple_debug_info("msn", "message new (%p)(%d)\n", msg, type); |
38 #endif | |
39 | 38 |
40 msg->attr_table = g_hash_table_new_full(g_str_hash, g_str_equal, | 39 msg->attr_table = g_hash_table_new_full(g_str_hash, g_str_equal, |
41 g_free, g_free); | 40 g_free, g_free); |
42 | 41 |
43 msn_message_ref(msg); | 42 msn_message_ref(msg); |
55 msn_message_unref(msg); | 54 msn_message_unref(msg); |
56 | 55 |
57 return; | 56 return; |
58 } | 57 } |
59 | 58 |
60 #ifdef MSN_DEBUG_MSG | 59 if (purple_debug_is_verbose()) |
61 purple_debug_info("msn", "message destroy (%p)\n", msg); | 60 purple_debug_info("msn", "message destroy (%p)\n", msg); |
62 #endif | |
63 | 61 |
64 g_free(msg->remote_user); | 62 g_free(msg->remote_user); |
65 g_free(msg->body); | 63 g_free(msg->body); |
66 g_free(msg->content_type); | 64 g_free(msg->content_type); |
67 g_free(msg->charset); | 65 g_free(msg->charset); |
77 { | 75 { |
78 g_return_val_if_fail(msg != NULL, NULL); | 76 g_return_val_if_fail(msg != NULL, NULL); |
79 | 77 |
80 msg->ref_count++; | 78 msg->ref_count++; |
81 | 79 |
82 #ifdef MSN_DEBUG_MSG | 80 if (purple_debug_is_verbose()) |
83 purple_debug_info("msn", "message ref (%p)[%" G_GSIZE_FORMAT "]\n", msg, msg->ref_count); | 81 purple_debug_info("msn", "message ref (%p)[%" G_GSIZE_FORMAT "]\n", msg, msg->ref_count); |
84 #endif | |
85 | 82 |
86 return msg; | 83 return msg; |
87 } | 84 } |
88 | 85 |
89 MsnMessage * | 86 MsnMessage * |
92 g_return_val_if_fail(msg != NULL, NULL); | 89 g_return_val_if_fail(msg != NULL, NULL); |
93 g_return_val_if_fail(msg->ref_count > 0, NULL); | 90 g_return_val_if_fail(msg->ref_count > 0, NULL); |
94 | 91 |
95 msg->ref_count--; | 92 msg->ref_count--; |
96 | 93 |
97 #ifdef MSN_DEBUG_MSG | 94 if (purple_debug_is_verbose()) |
98 purple_debug_info("msn", "message unref (%p)[%" G_GSIZE_FORMAT "]\n", msg, msg->ref_count); | 95 purple_debug_info("msn", "message unref (%p)[%" G_GSIZE_FORMAT "]\n", msg, msg->ref_count); |
99 #endif | |
100 | 96 |
101 if (msg->ref_count == 0) | 97 if (msg->ref_count == 0) |
102 { | 98 { |
103 msn_message_destroy(msg); | 99 msn_message_destroy(msg); |
104 | 100 |