comparison libpurple/protocols/qq/sys_msg.c @ 23051:55f986ccbb6a

patch-05-reconnect-and-code-cleanup
author SHiNE CsyFeK <csyfek@gmail.com>
date Tue, 24 Jun 2008 12:28:38 +0000
parents 51dbe83ebbd3
children 1c50f12b1c52
comparison
equal deleted inserted replaced
23050:51dbe83ebbd3 23051:55f986ccbb6a
118 } 118 }
119 119
120 /* Send ACK if the sys message needs an ACK */ 120 /* Send ACK if the sys message needs an ACK */
121 static void _qq_send_packet_ack_msg_sys(PurpleConnection *gc, guint8 code, guint32 from, guint16 seq) 121 static void _qq_send_packet_ack_msg_sys(PurpleConnection *gc, guint8 code, guint32 from, guint16 seq)
122 { 122 {
123 qq_data *qd;
123 guint8 bar, *ack; 124 guint8 bar, *ack;
124 gchar *str; 125 gchar *str;
125 gint ack_len, bytes; 126 gint ack_len, bytes;
126 127
128 qd = (qq_data *) gc->proto_data;
129
127 str = g_strdup_printf("%d", from); 130 str = g_strdup_printf("%d", from);
128 bar = 0x1e; 131 bar = 0x1e;
129 ack_len = 1 + 1 + strlen(str) + 1 + 2; 132 ack_len = 1 + 1 + strlen(str) + 1 + 2;
130 ack = g_newa(guint8, ack_len); 133 ack = g_newa(guint8, ack_len);
131 134
137 bytes += qq_put16(ack + bytes, seq); 140 bytes += qq_put16(ack + bytes, seq);
138 141
139 g_free(str); 142 g_free(str);
140 143
141 if (bytes == ack_len) /* creation OK */ 144 if (bytes == ack_len) /* creation OK */
142 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);
143 else 146 else
144 purple_debug(PURPLE_DEBUG_ERROR, "QQ", 147 purple_debug(PURPLE_DEBUG_ERROR, "QQ",
145 "Fail creating sys msg ACK, expect %d bytes, build %d bytes\n", ack_len, bytes); 148 "Fail creating sys msg ACK, expect %d bytes, build %d bytes\n", ack_len, bytes);
146 } 149 }
147 150