comparison libgaim/protocols/qq/group_network.c @ 14629:6b8bc59414f0

[gaim-migrate @ 17375] Get rid of these useless checks. committer: Tailor Script <tailor@pidgin.im>
author Mark Huetsch <markhuetsch>
date Tue, 26 Sep 2006 22:54:24 +0000
parents 8ff8f1c897b5
children d1a76ccb93c4
comparison
equal deleted inserted replaced
14628:58202142e9ad 14629:6b8bc59414f0
78 78
79 /* default process of reply error */ 79 /* default process of reply error */
80 static void _qq_process_group_cmd_reply_error_default(guint8 reply, guint8 *cursor, gint len, GaimConnection *gc) 80 static void _qq_process_group_cmd_reply_error_default(guint8 reply, guint8 *cursor, gint len, GaimConnection *gc)
81 { 81 {
82 gchar *msg, *msg_utf8; 82 gchar *msg, *msg_utf8;
83 g_return_if_fail(cursor != NULL && len > 0 && gc != NULL); 83 g_return_if_fail(cursor != NULL && len > 0);
84 84
85 msg = g_strndup((gchar *) cursor, len); /* it will append 0x00 */ 85 msg = g_strndup((gchar *) cursor, len); /* it will append 0x00 */
86 msg_utf8 = qq_to_utf8(msg, QQ_CHARSET_DEFAULT); 86 msg_utf8 = qq_to_utf8(msg, QQ_CHARSET_DEFAULT);
87 g_free(msg); 87 g_free(msg);
88 msg = g_strdup_printf(_("Code [0x%02X]: %s"), reply, msg_utf8); 88 msg = g_strdup_printf(_("Code [0x%02X]: %s"), reply, msg_utf8);
92 } 92 }
93 93
94 /* default process, dump only */ 94 /* default process, dump only */
95 static void _qq_process_group_cmd_reply_default(guint8 *data, guint8 **cursor, gint len, GaimConnection *gc) 95 static void _qq_process_group_cmd_reply_default(guint8 *data, guint8 **cursor, gint len, GaimConnection *gc)
96 { 96 {
97 g_return_if_fail(gc != NULL && data != NULL && len > 0); 97 g_return_if_fail(data != NULL && len > 0);
98 gaim_debug(GAIM_DEBUG_INFO, "QQ", "Dump unprocessed group cmd reply:\n%s", hex_dump_to_str(data, len)); 98 gaim_debug(GAIM_DEBUG_INFO, "QQ", "Dump unprocessed group cmd reply:\n%s", hex_dump_to_str(data, len));
99 } 99 }
100 100
101 /* The lower layer command of send group cmd */ 101 /* The lower layer command of send group cmd */
102 void qq_send_group_cmd(GaimConnection *gc, qq_group *group, guint8 *raw_data, gint data_len) 102 void qq_send_group_cmd(GaimConnection *gc, qq_group *group, guint8 *raw_data, gint data_len)
103 { 103 {
104 qq_data *qd; 104 qq_data *qd;
105 group_packet *p; 105 group_packet *p;
106 106
107 g_return_if_fail(gc != NULL);
108 g_return_if_fail(raw_data != NULL && data_len > 0); 107 g_return_if_fail(raw_data != NULL && data_len > 0);
109 108
110 qd = (qq_data *) gc->proto_data; 109 qd = (qq_data *) gc->proto_data;
111 g_return_if_fail(qd != NULL);
112 110
113 qq_send_cmd(gc, QQ_CMD_GROUP_CMD, TRUE, 0, TRUE, raw_data, data_len); 111 qq_send_cmd(gc, QQ_CMD_GROUP_CMD, TRUE, 0, TRUE, raw_data, data_len);
114 112
115 p = g_new0(group_packet, 1); 113 p = g_new0(group_packet, 1);
116 114
130 qq_data *qd; 128 qq_data *qd;
131 gint len, bytes; 129 gint len, bytes;
132 guint32 internal_group_id; 130 guint32 internal_group_id;
133 guint8 *data, *cursor, sub_cmd, reply; 131 guint8 *data, *cursor, sub_cmd, reply;
134 132
135 g_return_if_fail(gc != NULL && gc->proto_data != NULL);
136 g_return_if_fail(buf != NULL && buf_len != 0); 133 g_return_if_fail(buf != NULL && buf_len != 0);
137 134
138 qd = (qq_data *) gc->proto_data; 135 qd = (qq_data *) gc->proto_data;
139 len = buf_len; 136 len = buf_len;
140 data = g_newa(guint8, len); 137 data = g_newa(guint8, len);