Mercurial > pidgin
comparison libpurple/protocols/qq/group_find.c @ 15822: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
15821:84b0f9b23ede | 15822:32c366eeeb99 |
---|---|
1 /** | 1 /** |
2 * @file group_find.c | 2 * @file group_find.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 |
31 #include "qq.h" | 31 #include "qq.h" |
32 #include "utils.h" | 32 #include "utils.h" |
33 | 33 |
34 /* find the internal_group_id by the reply packet sequence | 34 /* find the internal_group_id by the reply packet sequence |
35 * return TRUE if we have a record of it, return FALSE if not */ | 35 * return TRUE if we have a record of it, return FALSE if not */ |
36 gboolean qq_group_find_internal_group_id_by_seq(GaimConnection *gc, guint16 seq, guint32 *internal_group_id) | 36 gboolean qq_group_find_internal_group_id_by_seq(PurpleConnection *gc, guint16 seq, guint32 *internal_group_id) |
37 { | 37 { |
38 GList *list; | 38 GList *list; |
39 qq_data *qd; | 39 qq_data *qd; |
40 group_packet *p; | 40 group_packet *p; |
41 | 41 |
94 list = list->next; | 94 list = list->next; |
95 } | 95 } |
96 } | 96 } |
97 } | 97 } |
98 | 98 |
99 qq_buddy *qq_group_find_or_add_member(GaimConnection *gc, qq_group *group, guint32 member_uid) | 99 qq_buddy *qq_group_find_or_add_member(PurpleConnection *gc, qq_group *group, guint32 member_uid) |
100 { | 100 { |
101 qq_buddy *member, *q_bud; | 101 qq_buddy *member, *q_bud; |
102 GaimBuddy *buddy; | 102 PurpleBuddy *buddy; |
103 g_return_val_if_fail(group != NULL && member_uid > 0, NULL); | 103 g_return_val_if_fail(group != NULL && member_uid > 0, NULL); |
104 | 104 |
105 member = qq_group_find_member_by_uid(group, member_uid); | 105 member = qq_group_find_member_by_uid(group, member_uid); |
106 if (member == NULL) { /* first appear during my session */ | 106 if (member == NULL) { /* first appear during my session */ |
107 member = g_new0(qq_buddy, 1); | 107 member = g_new0(qq_buddy, 1); |
108 member->uid = member_uid; | 108 member->uid = member_uid; |
109 buddy = gaim_find_buddy(gaim_connection_get_account(gc), uid_to_gaim_name(member_uid)); | 109 buddy = purple_find_buddy(purple_connection_get_account(gc), uid_to_purple_name(member_uid)); |
110 if (buddy != NULL) { | 110 if (buddy != NULL) { |
111 q_bud = (qq_buddy *) buddy->proto_data; | 111 q_bud = (qq_buddy *) buddy->proto_data; |
112 if (q_bud != NULL && q_bud->nickname != NULL) | 112 if (q_bud != NULL && q_bud->nickname != NULL) |
113 member->nickname = g_strdup(q_bud->nickname); | 113 member->nickname = g_strdup(q_bud->nickname); |
114 else if (buddy->alias != NULL) | 114 else if (buddy->alias != NULL) |
119 | 119 |
120 return member; | 120 return member; |
121 } | 121 } |
122 | 122 |
123 /* find a qq_group by chatroom channel */ | 123 /* find a qq_group by chatroom channel */ |
124 qq_group *qq_group_find_by_channel(GaimConnection *gc, gint channel) | 124 qq_group *qq_group_find_by_channel(PurpleConnection *gc, gint channel) |
125 { | 125 { |
126 GaimConversation *conv; | 126 PurpleConversation *conv; |
127 qq_data *qd; | 127 qq_data *qd; |
128 qq_group *group; | 128 qq_group *group; |
129 GList *list; | 129 GList *list; |
130 | 130 |
131 qd = (qq_data *) gc->proto_data; | 131 qd = (qq_data *) gc->proto_data; |
132 | 132 |
133 conv = gaim_find_chat(gc, channel); | 133 conv = purple_find_chat(gc, channel); |
134 g_return_val_if_fail(conv != NULL, NULL); | 134 g_return_val_if_fail(conv != NULL, NULL); |
135 | 135 |
136 list = qd->groups; | 136 list = qd->groups; |
137 group = NULL; | 137 group = NULL; |
138 while (list != NULL) { | 138 while (list != NULL) { |
139 group = (qq_group *) list->data; | 139 group = (qq_group *) list->data; |
140 if (!g_ascii_strcasecmp(gaim_conversation_get_name(conv), group->group_name_utf8)) | 140 if (!g_ascii_strcasecmp(purple_conversation_get_name(conv), group->group_name_utf8)) |
141 break; | 141 break; |
142 list = list->next; | 142 list = list->next; |
143 } | 143 } |
144 | 144 |
145 return group; | 145 return group; |
146 } | 146 } |
147 | 147 |
148 /* find a qq_group by its id, flag is QQ_INTERNAL_ID or QQ_EXTERNAL_ID */ | 148 /* find a qq_group by its id, flag is QQ_INTERNAL_ID or QQ_EXTERNAL_ID */ |
149 qq_group *qq_group_find_by_id(GaimConnection *gc, guint32 id, gboolean flag) | 149 qq_group *qq_group_find_by_id(PurpleConnection *gc, guint32 id, gboolean flag) |
150 { | 150 { |
151 GList *list; | 151 GList *list; |
152 qq_group *group; | 152 qq_group *group; |
153 qq_data *qd; | 153 qq_data *qd; |
154 | 154 |