~ubuntu-branches/ubuntu/intrepid/pidgin/intrepid-proposed

« back to all changes in this revision

Viewing changes to libpurple/protocols/qq/sys_msg.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2008-07-02 11:20:18 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20080702112018-14sy0yept6am7tc7
Tags: 1:2.4.3-0ubuntu1
* New upstream version:
  - can connect to the icq server (lp: #244591)
* debian/control,
  debian/rules:
  - build-depends on libsilc which is in main now (lp: #44728)
* debian/patches/16_yahoo_icon_crash.patch:
  - updated, some of the changes are in the new version

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
#include "header_info.h"
36
36
#include "packet_parse.h"
37
37
#include "qq.h"
38
 
#include "send_core.h"
 
38
#include "qq_network.h"
39
39
#include "sys_msg.h"
40
40
#include "utils.h"
41
41
 
120
120
/* Send ACK if the sys message needs an ACK */
121
121
static void _qq_send_packet_ack_msg_sys(PurpleConnection *gc, guint8 code, guint32 from, guint16 seq)
122
122
{
123
 
        guint8 bar, *ack, *cursor;
 
123
        qq_data *qd;
 
124
        guint8 bar, *ack;
124
125
        gchar *str;
125
126
        gint ack_len, bytes;
126
127
 
 
128
        qd = (qq_data *) gc->proto_data;
 
129
        
127
130
        str = g_strdup_printf("%d", from);
128
131
        bar = 0x1e;
129
132
        ack_len = 1 + 1 + strlen(str) + 1 + 2;
130
133
        ack = g_newa(guint8, ack_len);
131
 
        cursor = ack;
 
134
 
132
135
        bytes = 0;
133
 
 
134
 
        bytes += create_packet_b(ack, &cursor, code);
135
 
        bytes += create_packet_b(ack, &cursor, bar);
136
 
        bytes += create_packet_data(ack, &cursor, (guint8 *) str, strlen(str));
137
 
        bytes += create_packet_b(ack, &cursor, bar);
138
 
        bytes += create_packet_w(ack, &cursor, seq);
 
136
        bytes += qq_put8(ack + bytes, code);
 
137
        bytes += qq_put8(ack + bytes, bar);
 
138
        bytes += qq_putdata(ack + bytes, (guint8 *) str, strlen(str));
 
139
        bytes += qq_put8(ack + bytes, bar);
 
140
        bytes += qq_put16(ack + bytes, seq);
139
141
 
140
142
        g_free(str);
141
143
 
142
144
        if (bytes == ack_len)   /* creation OK */
143
 
                qq_send_cmd(gc, QQ_CMD_ACK_SYS_MSG, TRUE, 0, FALSE, ack, ack_len);
 
145
                qq_send_cmd_detail(qd, QQ_CMD_ACK_SYS_MSG, 0, FALSE, ack, ack_len);
144
146
        else
145
147
                purple_debug(PURPLE_DEBUG_ERROR, "QQ",
146
148
                           "Fail creating sys msg ACK, expect %d bytes, build %d bytes\n", ack_len, bytes);