Mercurial > pidgin.yaz
comparison libgaim/protocols/qq/group_opt.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 | c039c920e11c |
comparison
equal
deleted
inserted
replaced
14628:58202142e9ad | 14629:6b8bc59414f0 |
---|---|
79 | 79 |
80 static void _qq_group_member_opt(GaimConnection *gc, qq_group *group, gint operation, guint32 *members) | 80 static void _qq_group_member_opt(GaimConnection *gc, qq_group *group, gint operation, guint32 *members) |
81 { | 81 { |
82 guint8 *data, *cursor; | 82 guint8 *data, *cursor; |
83 gint i, count, data_len; | 83 gint i, count, data_len; |
84 g_return_if_fail(gc != NULL && group != NULL && members != NULL); | 84 g_return_if_fail(members != NULL); |
85 | 85 |
86 for (i = 0; members[i] != 0xffffffff; i++) {; | 86 for (i = 0; members[i] != 0xffffffff; i++) {; |
87 } | 87 } |
88 count = i; | 88 count = i; |
89 data_len = 6 + count * 4; | 89 data_len = 6 + count * 4; |
160 qq_buddy *q_bud; | 160 qq_buddy *q_bud; |
161 qq_data *qd; | 161 qq_data *qd; |
162 gint i = 0, old = 0, new = 0, del = 0, add = 0; | 162 gint i = 0, old = 0, new = 0, del = 0, add = 0; |
163 GList *list; | 163 GList *list; |
164 | 164 |
165 g_return_if_fail(gc != NULL && gc->proto_data != NULL && group != NULL); | 165 g_return_if_fail(group != NULL); |
166 qd = (qq_data *) gc->proto_data; | 166 qd = (qq_data *) gc->proto_data; |
167 if (new_members[0] == 0xffffffff) | 167 if (new_members[0] == 0xffffffff) |
168 return; | 168 return; |
169 | 169 |
170 old_members = g_newa(guint32, QQ_QUN_MEMBER_MAX); | 170 old_members = g_newa(guint32, QQ_QUN_MEMBER_MAX); |
212 | 212 |
213 void qq_group_process_modify_members_reply(guint8 *data, guint8 **cursor, gint len, GaimConnection *gc) | 213 void qq_group_process_modify_members_reply(guint8 *data, guint8 **cursor, gint len, GaimConnection *gc) |
214 { | 214 { |
215 guint32 internal_group_id; | 215 guint32 internal_group_id; |
216 qq_group *group; | 216 qq_group *group; |
217 g_return_if_fail(data != NULL && gc != NULL); | 217 g_return_if_fail(data != NULL); |
218 | 218 |
219 read_packet_dw(data, cursor, len, &internal_group_id); | 219 read_packet_dw(data, cursor, len, &internal_group_id); |
220 g_return_if_fail(internal_group_id > 0); | 220 g_return_if_fail(internal_group_id > 0); |
221 | 221 |
222 /* we should have its info locally */ | 222 /* we should have its info locally */ |
232 { | 232 { |
233 gint data_len, data_written; | 233 gint data_len, data_written; |
234 guint8 *data, *cursor; | 234 guint8 *data, *cursor; |
235 gchar *group_name, *group_desc, *notice; | 235 gchar *group_name, *group_desc, *notice; |
236 | 236 |
237 g_return_if_fail(gc != NULL && group != NULL); | 237 g_return_if_fail(group != NULL); |
238 | 238 |
239 group_name = group->group_name_utf8 == NULL ? "" : utf8_to_qq(group->group_name_utf8, QQ_CHARSET_DEFAULT); | 239 group_name = group->group_name_utf8 == NULL ? "" : utf8_to_qq(group->group_name_utf8, QQ_CHARSET_DEFAULT); |
240 group_desc = group->group_desc_utf8 == NULL ? "" : utf8_to_qq(group->group_desc_utf8, QQ_CHARSET_DEFAULT); | 240 group_desc = group->group_desc_utf8 == NULL ? "" : utf8_to_qq(group->group_desc_utf8, QQ_CHARSET_DEFAULT); |
241 notice = group->notice_utf8 == NULL ? "" : utf8_to_qq(group->notice_utf8, QQ_CHARSET_DEFAULT); | 241 notice = group->notice_utf8 == NULL ? "" : utf8_to_qq(group->notice_utf8, QQ_CHARSET_DEFAULT); |
242 | 242 |
281 | 281 |
282 void qq_group_process_modify_info_reply(guint8 *data, guint8 **cursor, gint len, GaimConnection *gc) | 282 void qq_group_process_modify_info_reply(guint8 *data, guint8 **cursor, gint len, GaimConnection *gc) |
283 { | 283 { |
284 guint32 internal_group_id; | 284 guint32 internal_group_id; |
285 qq_group *group; | 285 qq_group *group; |
286 g_return_if_fail(data != NULL && gc != NULL); | 286 g_return_if_fail(data != NULL); |
287 | 287 |
288 read_packet_dw(data, cursor, len, &internal_group_id); | 288 read_packet_dw(data, cursor, len, &internal_group_id); |
289 g_return_if_fail(internal_group_id > 0); | 289 g_return_if_fail(internal_group_id > 0); |
290 | 290 |
291 /* we should have its info locally */ | 291 /* we should have its info locally */ |
302 void qq_group_create_with_name(GaimConnection *gc, const gchar *name) | 302 void qq_group_create_with_name(GaimConnection *gc, const gchar *name) |
303 { | 303 { |
304 gint data_len, data_written; | 304 gint data_len, data_written; |
305 guint8 *data, *cursor; | 305 guint8 *data, *cursor; |
306 qq_data *qd; | 306 qq_data *qd; |
307 g_return_if_fail(gc != NULL && name != NULL); | 307 g_return_if_fail(name != NULL); |
308 | 308 |
309 qd = (qq_data *) gc->proto_data; | 309 qd = (qq_data *) gc->proto_data; |
310 data_len = 7 + 1 + strlen(name) + 2 + 1 + 1 + 4; | 310 data_len = 7 + 1 + strlen(name) + 2 + 1 + 1 + 4; |
311 data = g_newa(guint8, data_len); | 311 data = g_newa(guint8, data_len); |
312 cursor = data; | 312 cursor = data; |
357 guint32 internal_group_id, external_group_id; | 357 guint32 internal_group_id, external_group_id; |
358 qq_group *group; | 358 qq_group *group; |
359 gc_and_uid *g; | 359 gc_and_uid *g; |
360 qq_data *qd; | 360 qq_data *qd; |
361 | 361 |
362 g_return_if_fail(data != NULL && gc != NULL); | 362 g_return_if_fail(data != NULL); |
363 g_return_if_fail(gc->proto_data != NULL); | 363 g_return_if_fail(gc->proto_data != NULL); |
364 qd = (qq_data *) gc->proto_data; | 364 qd = (qq_data *) gc->proto_data; |
365 | 365 |
366 read_packet_dw(data, cursor, len, &internal_group_id); | 366 read_packet_dw(data, cursor, len, &internal_group_id); |
367 read_packet_dw(data, cursor, len, &external_group_id); | 367 read_packet_dw(data, cursor, len, &external_group_id); |
393 /* we have to activate group after creation, otherwise the group can not be searched */ | 393 /* we have to activate group after creation, otherwise the group can not be searched */ |
394 void qq_group_activate_group(GaimConnection *gc, guint32 internal_group_id) | 394 void qq_group_activate_group(GaimConnection *gc, guint32 internal_group_id) |
395 { | 395 { |
396 gint data_len, data_written; | 396 gint data_len, data_written; |
397 guint8 *data, *cursor; | 397 guint8 *data, *cursor; |
398 g_return_if_fail(gc != NULL && internal_group_id > 0); | 398 g_return_if_fail(internal_group_id > 0); |
399 | 399 |
400 data_len = 5; | 400 data_len = 5; |
401 data = g_newa(guint8, data_len); | 401 data = g_newa(guint8, data_len); |
402 cursor = data; | 402 cursor = data; |
403 | 403 |
418 | 418 |
419 void qq_group_process_activate_group_reply(guint8 *data, guint8 **cursor, gint len, GaimConnection *gc) | 419 void qq_group_process_activate_group_reply(guint8 *data, guint8 **cursor, gint len, GaimConnection *gc) |
420 { | 420 { |
421 guint32 internal_group_id; | 421 guint32 internal_group_id; |
422 qq_group *group; | 422 qq_group *group; |
423 g_return_if_fail(data != NULL && gc != NULL); | 423 g_return_if_fail(data != NULL); |
424 | 424 |
425 read_packet_dw(data, cursor, len, &internal_group_id); | 425 read_packet_dw(data, cursor, len, &internal_group_id); |
426 g_return_if_fail(internal_group_id > 0); | 426 g_return_if_fail(internal_group_id > 0); |
427 | 427 |
428 /* we should have its info locally */ | 428 /* we should have its info locally */ |
436 { | 436 { |
437 gchar *internal_group_id_ptr; | 437 gchar *internal_group_id_ptr; |
438 guint32 internal_group_id; | 438 guint32 internal_group_id; |
439 qq_group *group; | 439 qq_group *group; |
440 | 440 |
441 g_return_if_fail(gc != NULL && data != NULL); | 441 g_return_if_fail(data != NULL); |
442 | 442 |
443 internal_group_id_ptr = g_hash_table_lookup(data, "internal_group_id"); | 443 internal_group_id_ptr = g_hash_table_lookup(data, "internal_group_id"); |
444 internal_group_id = strtol(internal_group_id_ptr, NULL, 10); | 444 internal_group_id = strtol(internal_group_id_ptr, NULL, 10); |
445 g_return_if_fail(internal_group_id > 0); | 445 g_return_if_fail(internal_group_id > 0); |
446 | 446 |