libpurple/protocols/qq/im.c

changeset 22685
f3a524370c38
parent 19859
71d37b57eff2
child 23190
ce258cadbd9e
equal deleted inserted replaced
22678:1ac5b4cdb4a9 22685:f3a524370c38
566 566
567 qd = gc->proto_data; 567 qd = gc->proto_data;
568 len = buf_len; 568 len = buf_len;
569 data = g_newa(guint8, len); 569 data = g_newa(guint8, len);
570 570
571 if (qq_crypt(DECRYPT, buf, buf_len, qd->session_key, data, &len)) { 571 if (qq_decrypt(buf, buf_len, qd->session_key, data, &len)) {
572 cursor = data; 572 cursor = data;
573 read_packet_b(data, &cursor, len, &reply); 573 read_packet_b(data, &cursor, len, &reply);
574 if (reply != QQ_SEND_IM_REPLY_OK) { 574 if (reply != QQ_SEND_IM_REPLY_OK) {
575 purple_debug(PURPLE_DEBUG_WARNING, "QQ", "Send IM fail\n"); 575 purple_debug(PURPLE_DEBUG_WARNING, "QQ", "Send IM fail\n");
576 purple_notify_error(gc, _("Error"), _("Failed to send IM."), NULL); 576 purple_notify_error(gc, _("Error"), _("Failed to send IM."), NULL);
595 595
596 qd = (qq_data *) gc->proto_data; 596 qd = (qq_data *) gc->proto_data;
597 len = buf_len; 597 len = buf_len;
598 data = g_newa(guint8, len); 598 data = g_newa(guint8, len);
599 599
600 if (qq_crypt(DECRYPT, buf, buf_len, qd->session_key, data, &len)) { 600 if (qq_decrypt(buf, buf_len, qd->session_key, data, &len)) {
601 if (len < 16) { /* we need to ack with the first 16 bytes */ 601 if (len < 16) { /* we need to ack with the first 16 bytes */
602 purple_debug(PURPLE_DEBUG_ERROR, "QQ", "IM is too short\n"); 602 purple_debug(PURPLE_DEBUG_ERROR, "QQ", "IM is too short\n");
603 return; 603 return;
604 } else 604 } else
605 _qq_send_packet_recv_im_ack(gc, seq, data); 605 _qq_send_packet_recv_im_ack(gc, seq, data);

mercurial