Mercurial > pidgin.yaz
comparison libpurple/protocols/qq/buddy_opt.c @ 22527:217fffe3f46f
Patch from ccpaging to clean up some QQ stuff. I removed the now commented
out qq_crypt() instead of, well, comment it out.
author | Ka-Hing Cheung <khc@hxbc.us> |
---|---|
date | Mon, 24 Mar 2008 07:14:29 +0000 |
parents | dccfd999ffe7 |
children | 9a5d140400f1 |
comparison
equal
deleted
inserted
replaced
22526:06f195789c3e | 22527:217fffe3f46f |
---|---|
265 qd = (qq_data *) gc->proto_data; | 265 qd = (qq_data *) gc->proto_data; |
266 len = buf_len; | 266 len = buf_len; |
267 data = g_newa(guint8, len); | 267 data = g_newa(guint8, len); |
268 cursor = data; | 268 cursor = data; |
269 | 269 |
270 if (qq_crypt(DECRYPT, buf, buf_len, qd->session_key, data, &len)) { | 270 if (qq_decrypt(buf, buf_len, qd->session_key, data, &len)) { |
271 read_packet_b(data, &cursor, len, &reply); | 271 read_packet_b(data, &cursor, len, &reply); |
272 if (reply != QQ_ADD_BUDDY_AUTH_REPLY_OK) { | 272 if (reply != QQ_ADD_BUDDY_AUTH_REPLY_OK) { |
273 purple_debug(PURPLE_DEBUG_WARNING, "QQ", "Add buddy with auth request failed\n"); | 273 purple_debug(PURPLE_DEBUG_WARNING, "QQ", "Add buddy with auth request failed\n"); |
274 if (NULL == (segments = split_data(data, len, "\x1f", 2))) | 274 if (NULL == (segments = split_data(data, len, "\x1f", 2))) |
275 return; | 275 return; |
295 | 295 |
296 qd = (qq_data *) gc->proto_data; | 296 qd = (qq_data *) gc->proto_data; |
297 len = buf_len; | 297 len = buf_len; |
298 data = g_newa(guint8, len); | 298 data = g_newa(guint8, len); |
299 | 299 |
300 if (qq_crypt(DECRYPT, buf, buf_len, qd->session_key, data, &len)) { | 300 if (qq_decrypt(buf, buf_len, qd->session_key, data, &len)) { |
301 cursor = data; | 301 cursor = data; |
302 read_packet_b(data, &cursor, len, &reply); | 302 read_packet_b(data, &cursor, len, &reply); |
303 if (reply != QQ_REMOVE_BUDDY_REPLY_OK) { | 303 if (reply != QQ_REMOVE_BUDDY_REPLY_OK) { |
304 /* there is no reason return from server */ | 304 /* there is no reason return from server */ |
305 purple_debug(PURPLE_DEBUG_WARNING, "QQ", "Remove buddy fails\n"); | 305 purple_debug(PURPLE_DEBUG_WARNING, "QQ", "Remove buddy fails\n"); |
324 | 324 |
325 qd = (qq_data *) gc->proto_data; | 325 qd = (qq_data *) gc->proto_data; |
326 len = buf_len; | 326 len = buf_len; |
327 data = g_newa(guint8, len); | 327 data = g_newa(guint8, len); |
328 | 328 |
329 if (qq_crypt(DECRYPT, buf, buf_len, qd->session_key, data, &len)) { | 329 if (qq_decrypt(buf, buf_len, qd->session_key, data, &len)) { |
330 cursor = data; | 330 cursor = data; |
331 read_packet_b(data, &cursor, len, &reply); | 331 read_packet_b(data, &cursor, len, &reply); |
332 if (reply != QQ_REMOVE_SELF_REPLY_OK) | 332 if (reply != QQ_REMOVE_SELF_REPLY_OK) |
333 /* there is no reason return from server */ | 333 /* there is no reason return from server */ |
334 purple_debug(PURPLE_DEBUG_WARNING, "QQ", "Remove self fails\n"); | 334 purple_debug(PURPLE_DEBUG_WARNING, "QQ", "Remove self fails\n"); |
379 purple_debug(PURPLE_DEBUG_INFO, "QQ", "Add buddy reply [%d] is for id [%d]\n", seq, for_uid); | 379 purple_debug(PURPLE_DEBUG_INFO, "QQ", "Add buddy reply [%d] is for id [%d]\n", seq, for_uid); |
380 } | 380 } |
381 | 381 |
382 data = g_newa(guint8, len); | 382 data = g_newa(guint8, len); |
383 | 383 |
384 if (qq_crypt(DECRYPT, buf, buf_len, qd->session_key, data, &len)) { | 384 if (qq_decrypt(buf, buf_len, qd->session_key, data, &len)) { |
385 if (NULL == (segments = split_data(data, len, "\x1f", 2))) | 385 if (NULL == (segments = split_data(data, len, "\x1f", 2))) |
386 return; | 386 return; |
387 uid = segments[0]; | 387 uid = segments[0]; |
388 reply = segments[1]; | 388 reply = segments[1]; |
389 if (strtol(uid, NULL, 10) != qd->uid) { /* should not happen */ | 389 if (strtol(uid, NULL, 10) != qd->uid) { /* should not happen */ |