Mercurial > pidgin
comparison libpurple/protocols/qq/group_opt.c @ 24117:d57928c9dd8f
2008.09.19 - ccpaging <ccpaging(at)gmail.com>
* Rewrite buddy modify info, there is a ticket for this problem
* Use ship32 to trans action code between request packet and reply packet process
author | SHiNE CsyFeK <csyfek@gmail.com> |
---|---|
date | Fri, 19 Sep 2008 14:46:41 +0000 |
parents | bcfc98c7a55f |
children | bdfcfd71449c |
comparison
equal
deleted
inserted
replaced
24116:b72816d1a131 | 24117:d57928c9dd8f |
---|---|
95 | 95 |
96 void qq_group_search_application_with_struct(group_member_opt *g) | 96 void qq_group_search_application_with_struct(group_member_opt *g) |
97 { | 97 { |
98 g_return_if_fail(g != NULL && g->gc != NULL && g->member > 0); | 98 g_return_if_fail(g != NULL && g->gc != NULL && g->member > 0); |
99 | 99 |
100 qq_send_packet_get_info(g->gc, g->member, TRUE); /* we want to see window */ | 100 qq_request_buddy_info(g->gc, g->member, 0, QQ_BUDDY_INFO_DISPLAY); |
101 purple_request_action(g->gc, NULL, _("Do you want to approve the request?"), "", | 101 purple_request_action(g->gc, NULL, _("Do you want to approve the request?"), "", |
102 PURPLE_DEFAULT_ACTION_NONE, | 102 PURPLE_DEFAULT_ACTION_NONE, |
103 purple_connection_get_account(g->gc), NULL, NULL, | 103 purple_connection_get_account(g->gc), NULL, NULL, |
104 g, 2, | 104 g, 2, |
105 _("Reject"), G_CALLBACK(qq_group_reject_application_with_struct), | 105 _("Reject"), G_CALLBACK(qq_group_reject_application_with_struct), |
320 return; | 320 return; |
321 } | 321 } |
322 qq_send_room_cmd_noid(gc, QQ_ROOM_CMD_CREATE, data, bytes); | 322 qq_send_room_cmd_noid(gc, QQ_ROOM_CMD_CREATE, data, bytes); |
323 } | 323 } |
324 | 324 |
325 static void qq_group_setup_with_gc_and_uid(gc_and_uid *g) | 325 static void qq_group_setup_cb(qq_add_request *add_req) |
326 { | 326 { |
327 qq_group *group; | 327 qq_group *group; |
328 g_return_if_fail(g != NULL && g->gc != NULL && g->uid > 0); | 328 g_return_if_fail(add_req != NULL); |
329 | 329 if (add_req->gc == NULL || add_req->uid == 0) { |
330 group = qq_room_search_id(g->gc, g->uid); | 330 g_free(add_req); |
331 g_return_if_fail(group != NULL); | 331 return; |
332 } | |
333 | |
334 group = qq_room_search_id(add_req->gc, add_req->uid); | |
335 if (group == NULL) { | |
336 g_free(add_req); | |
337 return; | |
338 } | |
332 | 339 |
333 /* TODO insert UI code here */ | 340 /* TODO insert UI code here */ |
334 /* qq_group_detail_window_show(g->gc, group); */ | 341 /* qq_group_detail_window_show(g->gc, group); */ |
335 g_free(g); | 342 g_free(add_req); |
336 } | 343 } |
337 | 344 |
338 void qq_group_process_create_group_reply(guint8 *data, gint len, PurpleConnection *gc) | 345 void qq_group_process_create_group_reply(guint8 *data, gint len, PurpleConnection *gc) |
339 { | 346 { |
340 gint bytes; | 347 gint bytes; |
341 guint32 id, ext_id; | 348 guint32 id, ext_id; |
342 qq_group *group; | 349 qq_group *group; |
343 gc_and_uid *g; | 350 qq_add_request *add_req; |
344 qq_data *qd; | 351 qq_data *qd; |
345 | 352 |
346 g_return_if_fail(data != NULL); | 353 g_return_if_fail(data != NULL); |
347 g_return_if_fail(gc->proto_data != NULL); | 354 g_return_if_fail(gc->proto_data != NULL); |
348 qd = (qq_data *) gc->proto_data; | 355 qd = (qq_data *) gc->proto_data; |
360 qq_send_room_cmd_only(gc, QQ_ROOM_CMD_ACTIVATE, id); | 367 qq_send_room_cmd_only(gc, QQ_ROOM_CMD_ACTIVATE, id); |
361 qq_update_room(gc, 0, group->id); | 368 qq_update_room(gc, 0, group->id); |
362 | 369 |
363 purple_debug_info("QQ", "Succeed in create Qun, external ID %d\n", group->ext_id); | 370 purple_debug_info("QQ", "Succeed in create Qun, external ID %d\n", group->ext_id); |
364 | 371 |
365 g = g_new0(gc_and_uid, 1); | 372 add_req = g_new0(qq_add_request, 1); |
366 g->gc = gc; | 373 add_req->gc = gc; |
367 g->uid = id; | 374 add_req->uid = id; |
368 | 375 |
369 purple_request_action(gc, _("QQ Qun Operation"), | 376 purple_request_action(gc, _("QQ Qun Operation"), |
370 _("You have successfully created a Qun"), | 377 _("You have successfully created a Qun"), |
371 _ | 378 _("Would you like to set up the detail information now?"), |
372 ("Would you like to set up the detail information now?"), | |
373 1, | 379 1, |
374 purple_connection_get_account(gc), NULL, NULL, | 380 purple_connection_get_account(gc), NULL, NULL, |
375 g, 2, | 381 add_req, 2, |
376 _("Setup"), G_CALLBACK(qq_group_setup_with_gc_and_uid), | 382 _("Setup"), G_CALLBACK(qq_group_setup_cb), |
377 _("Cancel"), G_CALLBACK(qq_do_nothing_with_gc_and_uid)); | 383 _("Cancel"), G_CALLBACK(qq_group_cancel_cb)); |
378 } | 384 } |
379 | 385 |
380 void qq_group_process_activate_group_reply(guint8 *data, gint len, PurpleConnection *gc) | 386 void qq_group_process_activate_group_reply(guint8 *data, gint len, PurpleConnection *gc) |
381 { | 387 { |
382 gint bytes; | 388 gint bytes; |