Mercurial > pidgin.yaz
diff libpurple/protocols/qq/file_trans.c @ 15823:32c366eeeb99
sed -ie 's/gaim/purple/g'
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Mon, 19 Mar 2007 07:01:17 +0000 |
parents | 5fe8042783c1 |
children | b8572b937c09 |
line wrap: on
line diff
--- a/libpurple/protocols/qq/file_trans.c Mon Mar 19 06:11:46 2007 +0000 +++ b/libpurple/protocols/qq/file_trans.c Mon Mar 19 07:01:17 2007 +0000 @@ -1,9 +1,9 @@ /** * @file file_trans.c * - * gaim + * purple * - * Gaim is the legal property of its developers, whose names are too numerous + * Purple is the legal property of its developers, whose names are too numerous * to list here. Please refer to the COPYRIGHT file distributed with this * source distribution. * @@ -77,24 +77,24 @@ static void _fill_filename_md5(const gchar *filename, guint8 *md5) { - GaimCipher *cipher; - GaimCipherContext *context; + PurpleCipher *cipher; + PurpleCipherContext *context; g_return_if_fail(filename != NULL && md5 != NULL); - cipher = gaim_ciphers_find_cipher("md5"); - context = gaim_cipher_context_new(cipher, NULL); - gaim_cipher_context_append(context, (guint8 *) filename, strlen(filename)); - gaim_cipher_context_digest(context, 16, md5, NULL); - gaim_cipher_context_destroy(context); + cipher = purple_ciphers_find_cipher("md5"); + context = purple_cipher_context_new(cipher, NULL); + purple_cipher_context_append(context, (guint8 *) filename, strlen(filename)); + purple_cipher_context_digest(context, 16, md5, NULL); + purple_cipher_context_destroy(context); } static void _fill_file_md5(const gchar *filename, gint filelen, guint8 *md5) { FILE *fp; guint8 *buffer; - GaimCipher *cipher; - GaimCipherContext *context; + PurpleCipher *cipher; + PurpleCipherContext *context; const gint QQ_MAX_FILE_MD5_LENGTH = 10002432; @@ -109,11 +109,11 @@ g_return_if_fail(buffer != NULL); fread(buffer, filelen, 1, fp); - cipher = gaim_ciphers_find_cipher("md5"); - context = gaim_cipher_context_new(cipher, NULL); - gaim_cipher_context_append(context, buffer, filelen); - gaim_cipher_context_digest(context, 16, md5, NULL); - gaim_cipher_context_destroy(context); + cipher = purple_ciphers_find_cipher("md5"); + context = purple_cipher_context_new(cipher, NULL); + purple_cipher_context_append(context, buffer, filelen); + purple_cipher_context_digest(context, 16, md5, NULL); + purple_cipher_context_destroy(context); fclose(fp); } @@ -169,18 +169,18 @@ #ifdef USE_MMAP #include <sys/mman.h> -static int _qq_xfer_open_file(const gchar *filename, const gchar *method, GaimXfer *xfer) +static int _qq_xfer_open_file(const gchar *filename, const gchar *method, PurpleXfer *xfer) { ft_info *info = xfer->data; int fd; if (method[0] == 'r') { - fd = open(gaim_xfer_get_local_filename(xfer), O_RDONLY); - info->buffer = mmap(0, gaim_xfer_get_size(xfer), PROT_READ, MAP_PRIVATE, fd, 0); + fd = open(purple_xfer_get_local_filename(xfer), O_RDONLY); + info->buffer = mmap(0, purple_xfer_get_size(xfer), PROT_READ, MAP_PRIVATE, fd, 0); } else { - fd = open(gaim_xfer_get_local_filename(xfer), O_RDWR|O_CREAT, 0644); - info->buffer = mmap(0, gaim_xfer_get_size(xfer), PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FILE, fd, 0); + fd = open(purple_xfer_get_local_filename(xfer), O_RDWR|O_CREAT, 0644); + info->buffer = mmap(0, purple_xfer_get_size(xfer), PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FILE, fd, 0); } if (info->buffer == NULL) { @@ -189,18 +189,18 @@ return 0; } -static gint _qq_xfer_read_file(guint8 *buffer, guint index, guint len, GaimXfer *xfer) +static gint _qq_xfer_read_file(guint8 *buffer, guint index, guint len, PurpleXfer *xfer) { ft_info *info = xfer->data; gint readbytes; buffer = info->buffer + len * index; - readbytes = gaim_xfer_get_size(xfer) - (buffer - info->buffer); + readbytes = purple_xfer_get_size(xfer) - (buffer - info->buffer); if (readbytes > info->fragment_len) readbytes = info->fragment_len; return readbytes; } -static gint _qq_xfer_write_file(guint8 *buffer, guint index, guint len, GaimXfer *xfer) +static gint _qq_xfer_write_file(guint8 *buffer, guint index, guint len, PurpleXfer *xfer) { ft_info *info = xfer->data; @@ -208,24 +208,24 @@ return 0; } -void qq_xfer_close_file(GaimXfer *xfer) +void qq_xfer_close_file(PurpleXfer *xfer) { ft_info *info = xfer->data; - if (info->buffer) munmap(info->buffer, gaim_xfer_get_size(xfer)); + if (info->buffer) munmap(info->buffer, purple_xfer_get_size(xfer)); } #else -static int _qq_xfer_open_file(const gchar *filename, const gchar *method, GaimXfer *xfer) +static int _qq_xfer_open_file(const gchar *filename, const gchar *method, PurpleXfer *xfer) { ft_info *info = xfer->data; - info->dest_fp = fopen(gaim_xfer_get_local_filename(xfer), method); + info->dest_fp = fopen(purple_xfer_get_local_filename(xfer), method); if (info->dest_fp == NULL) { return -1; } return 0; } -static gint _qq_xfer_read_file(guint8 *buffer, guint index, guint len, GaimXfer *xfer) +static gint _qq_xfer_read_file(guint8 *buffer, guint index, guint len, PurpleXfer *xfer) { ft_info *info = xfer->data; @@ -233,14 +233,14 @@ return fread(buffer, 1, len, info->dest_fp); } -static gint _qq_xfer_write_file(guint8 *buffer, guint index, guint len, GaimXfer *xfer) +static gint _qq_xfer_write_file(guint8 *buffer, guint index, guint len, PurpleXfer *xfer) { ft_info *info = xfer->data; fseek(info->dest_fp, index * len, SEEK_SET); return fwrite(buffer, 1, len, info->dest_fp); } -void qq_xfer_close_file(GaimXfer *xfer) +void qq_xfer_close_file(PurpleXfer *xfer) { ft_info *info = xfer->data; @@ -248,7 +248,7 @@ } #endif -static gint _qq_send_file(GaimConnection *gc, guint8 *data, gint len, guint16 packet_type, guint32 to_uid) +static gint _qq_send_file(PurpleConnection *gc, guint8 *data, gint len, guint16 packet_type, guint32 to_uid) { gint bytes; guint8 *cursor, *buf; @@ -275,12 +275,12 @@ if (bytes == len + 12) { _qq_xfer_write(buf, bytes, qd->xfer); } else - gaim_debug(GAIM_DEBUG_INFO, "QQ", "send_file: want %d but got %d\n", len + 12, bytes); + purple_debug(PURPLE_DEBUG_INFO, "QQ", "send_file: want %d but got %d\n", len + 12, bytes); return bytes; } /* send a file to udp channel with QQ_FILE_CONTROL_PACKET_TAG */ -void qq_send_file_ctl_packet(GaimConnection *gc, guint16 packet_type, guint32 to_uid, guint8 hellobyte) +void qq_send_file_ctl_packet(PurpleConnection *gc, guint16 packet_type, guint32 to_uid, guint8 hellobyte) { qq_data *qd; gint bytes, bytes_expected, encrypted_len; @@ -338,14 +338,14 @@ bytes_expected = 61; break; default: - gaim_debug(GAIM_DEBUG_INFO, "QQ", "qq_send_file_ctl_packet: Unknown packet type[%d]\n", + purple_debug(PURPLE_DEBUG_INFO, "QQ", "qq_send_file_ctl_packet: Unknown packet type[%d]\n", packet_type); bytes_expected = 0; } if (bytes == bytes_expected) { gchar *hex_dump = hex_dump_to_str(raw_data, bytes); - gaim_debug(GAIM_DEBUG_INFO, "QQ", "sending packet[%s]: \n%s", qq_get_file_cmd_desc(packet_type), hex_dump); + purple_debug(PURPLE_DEBUG_INFO, "QQ", "sending packet[%s]: \n%s", qq_get_file_cmd_desc(packet_type), hex_dump); g_free(hex_dump); encrypted_len = bytes + 16; encrypted_data = g_newa(guint8, encrypted_len); @@ -356,33 +356,33 @@ guint8 *buf; int buflen; hex_dump = hex_dump_to_str(encrypted_data, encrypted_len); - gaim_debug(GAIM_DEBUG_INFO, "QQ", "encrypted packet: \n%s", hex_dump); + purple_debug(PURPLE_DEBUG_INFO, "QQ", "encrypted packet: \n%s", hex_dump); g_free(hex_dump); buf = g_newa(guint8, MAX_PACKET_SIZE); buflen = encrypted_len; if (qq_crypt(DECRYPT, encrypted_data, encrypted_len, info->file_session_key, buf, &buflen)) { - gaim_debug(GAIM_DEBUG_INFO, "QQ", "decrypt success\n"); + purple_debug(PURPLE_DEBUG_INFO, "QQ", "decrypt success\n"); if (buflen == bytes && memcmp(raw_data, buf, buflen) == 0) - gaim_debug(GAIM_DEBUG_INFO, "QQ", "checksum ok\n"); + purple_debug(PURPLE_DEBUG_INFO, "QQ", "checksum ok\n"); hex_dump = hex_dump_to_str(buf, buflen); - gaim_debug(GAIM_DEBUG_INFO, "QQ", "decrypted packet: \n%s", hex_dump); + purple_debug(PURPLE_DEBUG_INFO, "QQ", "decrypted packet: \n%s", hex_dump); g_free(hex_dump); } else { - gaim_debug(GAIM_DEBUG_INFO, "QQ", "decrypt fail\n"); + purple_debug(PURPLE_DEBUG_INFO, "QQ", "decrypt fail\n"); } } */ - gaim_debug(GAIM_DEBUG_INFO, "QQ", "<== send %s packet\n", qq_get_file_cmd_desc(packet_type)); + purple_debug(PURPLE_DEBUG_INFO, "QQ", "<== send %s packet\n", qq_get_file_cmd_desc(packet_type)); _qq_send_file(gc, encrypted_data, encrypted_len, QQ_FILE_CONTROL_PACKET_TAG, info->to_uid); } else - gaim_debug(GAIM_DEBUG_ERROR, "QQ", "qq_send_file_ctl_packet: Expected to get %d bytes, but get %d", + purple_debug(PURPLE_DEBUG_ERROR, "QQ", "qq_send_file_ctl_packet: Expected to get %d bytes, but get %d", bytes_expected, bytes); } /* send a file to udp channel with QQ_FILE_DATA_PACKET_TAG */ -static void _qq_send_file_data_packet(GaimConnection *gc, guint16 packet_type, guint8 sub_type, +static void _qq_send_file_data_packet(PurpleConnection *gc, guint16 packet_type, guint8 sub_type, guint32 fragment_index, guint16 seq, guint8 *data, gint len) { gint bytes; @@ -396,8 +396,8 @@ qd = (qq_data *) gc->proto_data; info = (ft_info *) qd->xfer->data; - filename = (gchar *) gaim_xfer_get_filename(qd->xfer); - filesize = gaim_xfer_get_size(qd->xfer); + filename = (gchar *) purple_xfer_get_filename(qd->xfer); + filesize = purple_xfer_get_size(qd->xfer); raw_data = g_newa(guint8, MAX_PACKET_SIZE); cursor = raw_data; @@ -418,14 +418,14 @@ case QQ_FILE_BASIC_INFO: filename_len = strlen(filename); _fill_filename_md5(filename, filename_md5); - _fill_file_md5(gaim_xfer_get_local_filename(qd->xfer), - gaim_xfer_get_size(qd->xfer), + _fill_file_md5(purple_xfer_get_local_filename(qd->xfer), + purple_xfer_get_size(qd->xfer), file_md5); info->fragment_num = (filesize - 1) / QQ_FILE_FRAGMENT_MAXLEN + 1; info->fragment_len = QQ_FILE_FRAGMENT_MAXLEN; - gaim_debug(GAIM_DEBUG_INFO, "QQ", + purple_debug(PURPLE_DEBUG_INFO, "QQ", "start transfering data, %d fragments with %d length each\n", info->fragment_num, info->fragment_len); /* Unknown */ @@ -450,7 +450,7 @@ filename_len); break; case QQ_FILE_DATA_INFO: - gaim_debug(GAIM_DEBUG_INFO, "QQ", + purple_debug(PURPLE_DEBUG_INFO, "QQ", "sending %dth fragment with length %d, offset %d\n", fragment_index, len, (fragment_index-1)*fragment_size); /* bytes += create_packet_w(raw_data, &cursor, ++(qd->send_seq)); */ @@ -463,11 +463,11 @@ bytes += create_packet_data(raw_data, &cursor, data, len); break; case QQ_FILE_EOF: - gaim_debug(GAIM_DEBUG_INFO, "QQ", "end of sending data\n"); + purple_debug(PURPLE_DEBUG_INFO, "QQ", "end of sending data\n"); /* bytes += create_packet_w(raw_data, &cursor, info->fragment_num + 1); */ bytes += create_packet_w(raw_data, &cursor, info->fragment_num); bytes += create_packet_b(raw_data, &cursor, sub_type); - /* gaim_xfer_set_completed(qd->xfer, TRUE); */ + /* purple_xfer_set_completed(qd->xfer, TRUE); */ } break; case QQ_FILE_CMD_FILE_OP_ACK: @@ -489,7 +489,7 @@ break; } } - gaim_debug(GAIM_DEBUG_INFO, "QQ", "<== send %s packet\n", qq_get_file_cmd_desc(packet_type)); + purple_debug(PURPLE_DEBUG_INFO, "QQ", "<== send %s packet\n", qq_get_file_cmd_desc(packet_type)); _qq_send_file(gc, raw_data, bytes, QQ_FILE_DATA_PACKET_TAG, info->to_uid); } @@ -512,7 +512,7 @@ */ -static void _qq_process_recv_file_ctl_packet(GaimConnection *gc, guint8 *data, guint8 *cursor, +static void _qq_process_recv_file_ctl_packet(PurpleConnection *gc, guint8 *data, guint8 *cursor, gint len, qq_file_header *fh) { guint8 *decrypted_data; @@ -532,9 +532,9 @@ read_packet_w(decrypted_data, &cursor, decrypted_len, &packet_type); read_packet_w(decrypted_data, &cursor, decrypted_len, &seq); cursor += 4+1+1+19+1; - gaim_debug(GAIM_DEBUG_INFO, "QQ", "==> [%d] receive %s packet\n", seq, qq_get_file_cmd_desc(packet_type)); + purple_debug(PURPLE_DEBUG_INFO, "QQ", "==> [%d] receive %s packet\n", seq, qq_get_file_cmd_desc(packet_type)); hex_dump = hex_dump_to_str(decrypted_data, decrypted_len); - gaim_debug(GAIM_DEBUG_INFO, "QQ", "decrypted control packet received: \n%s", hex_dump); + purple_debug(PURPLE_DEBUG_INFO, "QQ", "decrypted control packet received: \n%s", hex_dump); g_free(hex_dump); switch (packet_type) { case QQ_FILE_CMD_NOTIFY_IP_ACK: @@ -574,31 +574,31 @@ qq_send_file_ctl_packet(gc, QQ_FILE_CMD_SENDER_SAY_HELLO, fh->sender_uid, 0); break; default: - gaim_debug(GAIM_DEBUG_INFO, "QQ", "unprocess file command %d\n", packet_type); + purple_debug(PURPLE_DEBUG_INFO, "QQ", "unprocess file command %d\n", packet_type); } } } -static void _qq_recv_file_progess(GaimConnection *gc, guint8 *buffer, guint16 len, guint32 index, guint32 offset) +static void _qq_recv_file_progess(PurpleConnection *gc, guint8 *buffer, guint16 len, guint32 index, guint32 offset) { qq_data *qd = (qq_data *) gc->proto_data; - GaimXfer *xfer = qd->xfer; + PurpleXfer *xfer = qd->xfer; ft_info *info = (ft_info *) xfer->data; guint32 mask; - gaim_debug(GAIM_DEBUG_INFO, "QQ", + purple_debug(PURPLE_DEBUG_INFO, "QQ", "receiving %dth fragment with length %d, slide window status %o, max_fragment_index %d\n", index, len, info->window, info->max_fragment_index); if (info->window == 0 && info->max_fragment_index == 0) { - if (_qq_xfer_open_file(gaim_xfer_get_local_filename(xfer), "wb", xfer) == -1) { - gaim_xfer_cancel_local(xfer); + if (_qq_xfer_open_file(purple_xfer_get_local_filename(xfer), "wb", xfer) == -1) { + purple_xfer_cancel_local(xfer); return; } - gaim_debug(GAIM_DEBUG_INFO, "QQ", "object file opened for writing\n"); + purple_debug(PURPLE_DEBUG_INFO, "QQ", "object file opened for writing\n"); } mask = 0x1 << (index % sizeof(info->window)); if (index < info->max_fragment_index || (info->window & mask)) { - gaim_debug(GAIM_DEBUG_INFO, "QQ", "duplicate %dth fragment, drop it!\n", index+1); + purple_debug(PURPLE_DEBUG_INFO, "QQ", "duplicate %dth fragment, drop it!\n", index+1); return; } @@ -608,7 +608,7 @@ xfer->bytes_sent += len; xfer->bytes_remaining -= len; - gaim_xfer_update_progress(xfer); + purple_xfer_update_progress(xfer); mask = 0x1 << (info->max_fragment_index % sizeof(info->window)); while (info->window & mask) @@ -618,25 +618,25 @@ if (mask & 0x8000) mask = 0x0001; else mask = mask << 1; } - gaim_debug(GAIM_DEBUG_INFO, "QQ", "procceed %dth fragment, slide window status %o, max_fragment_index %d\n", + purple_debug(PURPLE_DEBUG_INFO, "QQ", "procceed %dth fragment, slide window status %o, max_fragment_index %d\n", index, info->window, info->max_fragment_index); } -static void _qq_send_file_progess(GaimConnection *gc) +static void _qq_send_file_progess(PurpleConnection *gc) { qq_data *qd = (qq_data *) gc->proto_data; - GaimXfer *xfer = qd->xfer; + PurpleXfer *xfer = qd->xfer; ft_info *info = (ft_info *) xfer->data; guint32 mask; guint8 *buffer; guint i; gint readbytes; - if (gaim_xfer_get_bytes_remaining(xfer) <= 0) return; + if (purple_xfer_get_bytes_remaining(xfer) <= 0) return; if (info->window == 0 && info->max_fragment_index == 0) { - if (_qq_xfer_open_file(gaim_xfer_get_local_filename(xfer), "rb", xfer) == -1) { - gaim_xfer_cancel_local(xfer); + if (_qq_xfer_open_file(purple_xfer_get_local_filename(xfer), "rb", xfer) == -1) { + purple_xfer_cancel_local(xfer); return; } } @@ -654,21 +654,21 @@ } } -static void _qq_update_send_progess(GaimConnection *gc, guint32 fragment_index) +static void _qq_update_send_progess(PurpleConnection *gc, guint32 fragment_index) { guint32 mask; guint8 *buffer; gint readbytes; qq_data *qd = (qq_data *) gc->proto_data; - GaimXfer *xfer = qd->xfer; + PurpleXfer *xfer = qd->xfer; ft_info *info = (ft_info *) xfer->data; - gaim_debug(GAIM_DEBUG_INFO, "QQ", + purple_debug(PURPLE_DEBUG_INFO, "QQ", "receiving %dth fragment ack, slide window status %o, max_fragment_index %d\n", fragment_index, info->window, info->max_fragment_index); if (fragment_index < info->max_fragment_index || fragment_index >= info->max_fragment_index + sizeof(info->window)) { - gaim_debug(GAIM_DEBUG_INFO, "QQ", "duplicate %dth fragment, drop it!\n", fragment_index+1); + purple_debug(PURPLE_DEBUG_INFO, "QQ", "duplicate %dth fragment, drop it!\n", fragment_index+1); return; } mask = 0x1 << (fragment_index % sizeof(info->window)); @@ -678,13 +678,13 @@ if (fragment_index + 1 != info->fragment_num) { xfer->bytes_sent += info->fragment_len; } else { - xfer->bytes_sent += gaim_xfer_get_size(xfer) % info->fragment_len; + xfer->bytes_sent += purple_xfer_get_size(xfer) % info->fragment_len; } - xfer->bytes_remaining = gaim_xfer_get_size(xfer) - gaim_xfer_get_bytes_sent(xfer); - gaim_xfer_update_progress(xfer); - if (gaim_xfer_get_bytes_remaining(xfer) <= 0) { + xfer->bytes_remaining = purple_xfer_get_size(xfer) - purple_xfer_get_bytes_sent(xfer); + purple_xfer_update_progress(xfer); + if (purple_xfer_get_bytes_remaining(xfer) <= 0) { /* We have finished sending the file */ - gaim_xfer_set_completed(xfer, TRUE); + purple_xfer_set_completed(xfer, TRUE); return; } mask = 0x1 << (info->max_fragment_index % sizeof(info->window)); @@ -705,12 +705,12 @@ else mask = mask << 1; } } - gaim_debug(GAIM_DEBUG_INFO, "QQ", + purple_debug(PURPLE_DEBUG_INFO, "QQ", "procceed %dth fragment ack, slide window status %o, max_fragment_index %d\n", fragment_index, info->window, info->max_fragment_index); } -static void _qq_process_recv_file_data(GaimConnection *gc, guint8 *data, guint8 *cursor, +static void _qq_process_recv_file_data(PurpleConnection *gc, guint8 *data, guint8 *cursor, gint len, guint32 to_uid) { guint16 packet_type; @@ -742,7 +742,7 @@ info->max_fragment_index = 0; info->window = 0; - gaim_debug(GAIM_DEBUG_INFO, "QQ", + purple_debug(PURPLE_DEBUG_INFO, "QQ", "start receiving data, %d fragments with %d length each\n", info->fragment_num, info->fragment_len); _qq_send_file_data_packet(gc, QQ_FILE_CMD_FILE_OP_ACK, sub_type, @@ -752,7 +752,7 @@ read_packet_dw(data, &cursor, len, &fragment_index); read_packet_dw(data, &cursor, len, &fragment_offset); read_packet_w(data, &cursor, len, &fragment_len); - gaim_debug(GAIM_DEBUG_INFO, "QQ", + purple_debug(PURPLE_DEBUG_INFO, "QQ", "received %dth fragment with length %d, offset %d\n", fragment_index, fragment_len, fragment_offset); @@ -761,7 +761,7 @@ _qq_recv_file_progess(gc, cursor, fragment_len, fragment_index, fragment_offset); break; case QQ_FILE_EOF: - gaim_debug(GAIM_DEBUG_INFO, "QQ", "end of receiving\n"); + purple_debug(PURPLE_DEBUG_INFO, "QQ", "end of receiving\n"); _qq_send_file_data_packet(gc, QQ_FILE_CMD_FILE_OP_ACK, sub_type, 0, 0, NULL, 0); break; @@ -781,7 +781,7 @@ case QQ_FILE_DATA_INFO: read_packet_dw(data, &cursor, len, &fragment_index); _qq_update_send_progess(gc, fragment_index); - if (gaim_xfer_is_completed(qd->xfer)) + if (purple_xfer_is_completed(qd->xfer)) _qq_send_file_data_packet(gc, QQ_FILE_CMD_FILE_OP, QQ_FILE_EOF, 0, 0, NULL, 0); /* else _qq_send_file_progess(gc); */ @@ -790,27 +790,27 @@ /* FIXME: OK, we can end the connection successfully */ _qq_send_file_data_packet(gc, QQ_FILE_EOF, 0, 0, 0, NULL, 0); - gaim_xfer_set_completed(qd->xfer, TRUE); + purple_xfer_set_completed(qd->xfer, TRUE); break; } break; case QQ_FILE_EOF: _qq_send_file_data_packet(gc, QQ_FILE_EOF, 0, 0, 0, NULL, 0); - gaim_xfer_set_completed(qd->xfer, TRUE); - gaim_xfer_end(qd->xfer); + purple_xfer_set_completed(qd->xfer, TRUE); + purple_xfer_end(qd->xfer); break; case QQ_FILE_BASIC_INFO: - gaim_debug(GAIM_DEBUG_INFO, "QQ", "here\n"); + purple_debug(PURPLE_DEBUG_INFO, "QQ", "here\n"); _qq_send_file_data_packet(gc, QQ_FILE_DATA_INFO, 0, 0, 0, NULL, 0); break; default: - gaim_debug(GAIM_DEBUG_INFO, "QQ", "_qq_process_recv_file_data: unknown packet type [%d]\n", + purple_debug(PURPLE_DEBUG_INFO, "QQ", "_qq_process_recv_file_data: unknown packet type [%d]\n", packet_type); break; } } -void qq_process_recv_file(GaimConnection *gc, guint8 *data, gint len) +void qq_process_recv_file(PurpleConnection *gc, guint8 *data, gint len) { guint8 *cursor; qq_file_header fh; @@ -829,6 +829,6 @@ _qq_process_recv_file_data(gc, data, cursor, len, fh.sender_uid); break; default: - gaim_debug(GAIM_DEBUG_INFO, "QQ", "unknown packet tag"); + purple_debug(PURPLE_DEBUG_INFO, "QQ", "unknown packet tag"); } }