Mercurial > pidgin.yaz
comparison libpurple/protocols/msn/slpmsg.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 | c6c714b7841d |
children | 6aea98f6a5cd |
comparison
equal
deleted
inserted
replaced
27508:9c413bda20be | 27509:35b6fd563056 |
---|---|
34 { | 34 { |
35 MsnSlpMessage *slpmsg; | 35 MsnSlpMessage *slpmsg; |
36 | 36 |
37 slpmsg = g_new0(MsnSlpMessage, 1); | 37 slpmsg = g_new0(MsnSlpMessage, 1); |
38 | 38 |
39 #ifdef MSN_DEBUG_SLPMSG | 39 if (purple_debug_is_verbose()) |
40 purple_debug_info("msn", "slpmsg new (%p)\n", slpmsg); | 40 purple_debug_info("msn", "slpmsg new (%p)\n", slpmsg); |
41 #endif | |
42 | 41 |
43 slpmsg->slplink = slplink; | 42 slpmsg->slplink = slplink; |
44 | 43 |
45 slplink->slp_msgs = | 44 slplink->slp_msgs = |
46 g_list_append(slplink->slp_msgs, slpmsg); | 45 g_list_append(slplink->slp_msgs, slpmsg); |
54 MsnSlpLink *slplink; | 53 MsnSlpLink *slplink; |
55 GList *cur; | 54 GList *cur; |
56 | 55 |
57 g_return_if_fail(slpmsg != NULL); | 56 g_return_if_fail(slpmsg != NULL); |
58 | 57 |
59 #ifdef MSN_DEBUG_SLPMSG | 58 if (purple_debug_is_verbose()) |
60 purple_debug_info("msn", "slpmsg destroy (%p)\n", slpmsg); | 59 purple_debug_info("msn", "slpmsg destroy (%p)\n", slpmsg); |
61 #endif | |
62 | 60 |
63 slplink = slpmsg->slplink; | 61 slplink = slpmsg->slplink; |
64 | 62 |
65 if (slpmsg->fp != NULL) | 63 if (slpmsg->fp != NULL) |
66 fclose(slpmsg->fp); | 64 fclose(slpmsg->fp); |
69 | 67 |
70 /* We don't want to free the data of the PurpleStoredImage, | 68 /* We don't want to free the data of the PurpleStoredImage, |
71 * but to avoid code duplication, it's sharing buffer. */ | 69 * but to avoid code duplication, it's sharing buffer. */ |
72 if (slpmsg->img == NULL) | 70 if (slpmsg->img == NULL) |
73 g_free(slpmsg->buffer); | 71 g_free(slpmsg->buffer); |
74 | |
75 #ifdef MSN_DEBUG_SLP | |
76 /* | |
77 if (slpmsg->info != NULL) | |
78 g_free(slpmsg->info); | |
79 */ | |
80 #endif | |
81 | 72 |
82 for (cur = slpmsg->msgs; cur != NULL; cur = cur->next) | 73 for (cur = slpmsg->msgs; cur != NULL; cur = cur->next) |
83 { | 74 { |
84 /* Something is pointing to this slpmsg, so we should remove that | 75 /* Something is pointing to this slpmsg, so we should remove that |
85 * pointer to prevent a crash. */ | 76 * pointer to prevent a crash. */ |
86 /* Ex: a user goes offline and after that we receive an ACK */ | 77 /* Ex: a user goes offline and after that we receive an ACK */ |
87 | 78 |
88 MsnMessage *msg = cur->data; | 79 MsnMessage *msg = cur->data; |
89 | 80 |
90 #ifdef MSN_DEBUG_SLPMSG | |
91 purple_debug_info("msn", "Unlink slpmsg callbacks.\n"); | |
92 #endif | |
93 | |
94 msg->ack_cb = NULL; | 81 msg->ack_cb = NULL; |
95 msg->nak_cb = NULL; | 82 msg->nak_cb = NULL; |
96 msg->ack_data = NULL; | 83 msg->ack_data = NULL; |
97 } | 84 } |
98 g_list_free(slpmsg->msgs); | 85 g_list_free(slpmsg->msgs); |
130 slpmsg->img = purple_imgstore_ref(img); | 117 slpmsg->img = purple_imgstore_ref(img); |
131 slpmsg->buffer = (guchar *)purple_imgstore_get_data(img); | 118 slpmsg->buffer = (guchar *)purple_imgstore_get_data(img); |
132 slpmsg->size = purple_imgstore_get_size(img); | 119 slpmsg->size = purple_imgstore_get_size(img); |
133 } | 120 } |
134 | 121 |
135 #ifdef MSN_DEBUG_SLP | |
136 void | 122 void |
137 msn_slpmsg_show(MsnMessage *msg) | 123 msn_slpmsg_show(MsnMessage *msg) |
138 { | 124 { |
139 const char *info; | 125 const char *info; |
140 gboolean text; | 126 gboolean text; |
159 info = "SLP UNKNOWN"; break; | 145 info = "SLP UNKNOWN"; break; |
160 } | 146 } |
161 | 147 |
162 msn_message_show_readable(msg, info, text); | 148 msn_message_show_readable(msg, info, text); |
163 } | 149 } |
164 #endif | |
165 | 150 |
166 MsnSlpMessage * | 151 MsnSlpMessage * |
167 msn_slpmsg_sip_new(MsnSlpCall *slpcall, int cseq, | 152 msn_slpmsg_sip_new(MsnSlpCall *slpcall, int cseq, |
168 const char *header, const char *branch, | 153 const char *header, const char *branch, |
169 const char *content_type, const char *content) | 154 const char *content_type, const char *content) |