Mercurial > pidgin.yaz
comparison libpurple/protocols/qq/group_search.c @ 15823:32c366eeeb99
sed -ie 's/gaim/purple/g'
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Mon, 19 Mar 2007 07:01:17 +0000 |
parents | 5fe8042783c1 |
children | b8572b937c09 |
comparison
equal
deleted
inserted
replaced
15822:84b0f9b23ede | 15823:32c366eeeb99 |
---|---|
1 /** | 1 /** |
2 * @file group_search.c | 2 * @file group_search.c |
3 * | 3 * |
4 * gaim | 4 * purple |
5 * | 5 * |
6 * Gaim is the legal property of its developers, whose names are too numerous | 6 * Purple is the legal property of its developers, whose names are too numerous |
7 * to list here. Please refer to the COPYRIGHT file distributed with this | 7 * to list here. Please refer to the COPYRIGHT file distributed with this |
8 * source distribution. | 8 * source distribution. |
9 * | 9 * |
10 * This program is free software; you can redistribute it and/or modify | 10 * This program is free software; you can redistribute it and/or modify |
11 * it under the terms of the GNU General Public License as published by | 11 * it under the terms of the GNU General Public License as published by |
37 QQ_GROUP_SEARCH_TYPE_BY_ID = 0x01, | 37 QQ_GROUP_SEARCH_TYPE_BY_ID = 0x01, |
38 QQ_GROUP_SEARCH_TYPE_DEMO = 0x02 | 38 QQ_GROUP_SEARCH_TYPE_DEMO = 0x02 |
39 }; | 39 }; |
40 | 40 |
41 /* send packet to search for qq_group */ | 41 /* send packet to search for qq_group */ |
42 void qq_send_cmd_group_search_group(GaimConnection *gc, guint32 external_group_id) | 42 void qq_send_cmd_group_search_group(PurpleConnection *gc, guint32 external_group_id) |
43 { | 43 { |
44 guint8 *raw_data, *cursor, type; | 44 guint8 *raw_data, *cursor, type; |
45 gint bytes, data_len; | 45 gint bytes, data_len; |
46 | 46 |
47 data_len = 6; | 47 data_len = 6; |
53 bytes += create_packet_b(raw_data, &cursor, QQ_GROUP_CMD_SEARCH_GROUP); | 53 bytes += create_packet_b(raw_data, &cursor, QQ_GROUP_CMD_SEARCH_GROUP); |
54 bytes += create_packet_b(raw_data, &cursor, type); | 54 bytes += create_packet_b(raw_data, &cursor, type); |
55 bytes += create_packet_dw(raw_data, &cursor, external_group_id); | 55 bytes += create_packet_dw(raw_data, &cursor, external_group_id); |
56 | 56 |
57 if (bytes != data_len) | 57 if (bytes != data_len) |
58 gaim_debug(GAIM_DEBUG_ERROR, "QQ", | 58 purple_debug(PURPLE_DEBUG_ERROR, "QQ", |
59 "Fail create packet for %s\n", qq_group_cmd_get_desc(QQ_GROUP_CMD_SEARCH_GROUP)); | 59 "Fail create packet for %s\n", qq_group_cmd_get_desc(QQ_GROUP_CMD_SEARCH_GROUP)); |
60 else | 60 else |
61 qq_send_group_cmd(gc, NULL, raw_data, data_len); | 61 qq_send_group_cmd(gc, NULL, raw_data, data_len); |
62 } | 62 } |
63 | 63 |
64 static void _qq_setup_roomlist(qq_data *qd, qq_group *group) | 64 static void _qq_setup_roomlist(qq_data *qd, qq_group *group) |
65 { | 65 { |
66 GaimRoomlistRoom *room; | 66 PurpleRoomlistRoom *room; |
67 gchar field[11]; | 67 gchar field[11]; |
68 | 68 |
69 room = gaim_roomlist_room_new(GAIM_ROOMLIST_ROOMTYPE_ROOM, group->group_name_utf8, NULL); | 69 room = purple_roomlist_room_new(PURPLE_ROOMLIST_ROOMTYPE_ROOM, group->group_name_utf8, NULL); |
70 g_snprintf(field, sizeof(field), "%d", group->external_group_id); | 70 g_snprintf(field, sizeof(field), "%d", group->external_group_id); |
71 gaim_roomlist_room_add_field(qd->roomlist, room, field); | 71 purple_roomlist_room_add_field(qd->roomlist, room, field); |
72 g_snprintf(field, sizeof(field), "%d", group->creator_uid); | 72 g_snprintf(field, sizeof(field), "%d", group->creator_uid); |
73 gaim_roomlist_room_add_field(qd->roomlist, room, field); | 73 purple_roomlist_room_add_field(qd->roomlist, room, field); |
74 gaim_roomlist_room_add_field(qd->roomlist, room, group->group_desc_utf8); | 74 purple_roomlist_room_add_field(qd->roomlist, room, group->group_desc_utf8); |
75 g_snprintf(field, sizeof(field), "%d", group->internal_group_id); | 75 g_snprintf(field, sizeof(field), "%d", group->internal_group_id); |
76 gaim_roomlist_room_add_field(qd->roomlist, room, field); | 76 purple_roomlist_room_add_field(qd->roomlist, room, field); |
77 g_snprintf(field, sizeof(field), "%d", group->group_type); | 77 g_snprintf(field, sizeof(field), "%d", group->group_type); |
78 gaim_roomlist_room_add_field(qd->roomlist, room, field); | 78 purple_roomlist_room_add_field(qd->roomlist, room, field); |
79 g_snprintf(field, sizeof(field), "%d", group->auth_type); | 79 g_snprintf(field, sizeof(field), "%d", group->auth_type); |
80 gaim_roomlist_room_add_field(qd->roomlist, room, field); | 80 purple_roomlist_room_add_field(qd->roomlist, room, field); |
81 g_snprintf(field, sizeof(field), "%d", group->group_category); | 81 g_snprintf(field, sizeof(field), "%d", group->group_category); |
82 gaim_roomlist_room_add_field(qd->roomlist, room, field); | 82 purple_roomlist_room_add_field(qd->roomlist, room, field); |
83 gaim_roomlist_room_add_field(qd->roomlist, room, group->group_name_utf8); | 83 purple_roomlist_room_add_field(qd->roomlist, room, group->group_name_utf8); |
84 gaim_roomlist_room_add(qd->roomlist, room); | 84 purple_roomlist_room_add(qd->roomlist, room); |
85 | 85 |
86 gaim_roomlist_set_in_progress(qd->roomlist, FALSE); | 86 purple_roomlist_set_in_progress(qd->roomlist, FALSE); |
87 } | 87 } |
88 | 88 |
89 /* process group cmd reply "search group" */ | 89 /* process group cmd reply "search group" */ |
90 void qq_process_group_cmd_search_group(guint8 *data, guint8 **cursor, gint len, GaimConnection *gc) | 90 void qq_process_group_cmd_search_group(guint8 *data, guint8 **cursor, gint len, PurpleConnection *gc) |
91 { | 91 { |
92 guint8 search_type; | 92 guint8 search_type; |
93 guint16 unknown; | 93 guint16 unknown; |
94 gint bytes, pascal_len; | 94 gint bytes, pascal_len; |
95 qq_data *qd; | 95 qq_data *qd; |
122 pascal_len = convert_as_pascal_string(*cursor, &(group->group_desc_utf8), QQ_CHARSET_DEFAULT); | 122 pascal_len = convert_as_pascal_string(*cursor, &(group->group_desc_utf8), QQ_CHARSET_DEFAULT); |
123 bytes += pascal_len; | 123 bytes += pascal_len; |
124 *cursor += pascal_len; | 124 *cursor += pascal_len; |
125 /* end of one qq_group */ | 125 /* end of one qq_group */ |
126 if(*cursor != (data + len)) { | 126 if(*cursor != (data + len)) { |
127 gaim_debug(GAIM_DEBUG_ERROR, "QQ", | 127 purple_debug(PURPLE_DEBUG_ERROR, "QQ", |
128 "group_cmd_search_group: Dangerous error! maybe protocol changed, notify developers!"); | 128 "group_cmd_search_group: Dangerous error! maybe protocol changed, notify developers!"); |
129 } | 129 } |
130 | 130 |
131 pending_id = qq_get_pending_id(qd->joining_groups, group->external_group_id); | 131 pending_id = qq_get_pending_id(qd->joining_groups, group->external_group_id); |
132 if (pending_id != NULL) { | 132 if (pending_id != NULL) { |