comparison src/list.c @ 4865:3bc5a65728fb

[gaim-migrate @ 5195] this should hopefully fix the hanging of gaim when you drag buddies around committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sat, 22 Mar 2003 21:56:48 +0000
parents 46fb754a3c10
children cfa045006bec
comparison
equal deleted inserted replaced
4864:aedb32c5a920 4865:3bc5a65728fb
199 { 199 {
200 GaimBlistNode *n = node, *node2, *node3; 200 GaimBlistNode *n = node, *node2, *node3;
201 struct group *g = group; 201 struct group *g = group;
202 struct gaim_blist_ui_ops *ops = gaimbuddylist->ui_ops; 202 struct gaim_blist_ui_ops *ops = gaimbuddylist->ui_ops;
203 gboolean save = FALSE; 203 gboolean save = FALSE;
204
205 /* if we're moving to overtop of ourselves, do nothing */
206 if((GaimBlistNode*)buddy == node)
207 return;
208
204 if (!n) { 209 if (!n) {
205 if (!g) { 210 if (!g) {
206 g = gaim_group_new(_("Buddies")); 211 g = gaim_group_new(_("Buddies"));
207 gaim_blist_add_group(g, NULL); 212 gaim_blist_add_group(g, NULL);
208 } 213 }
214 * being moved. 219 * being moved.
215 */ 220 */
216 ops->remove(gaimbuddylist, (GaimBlistNode*)buddy); 221 ops->remove(gaimbuddylist, (GaimBlistNode*)buddy);
217 node2 = ((GaimBlistNode*)buddy)->next; 222 node2 = ((GaimBlistNode*)buddy)->next;
218 node3 = ((GaimBlistNode*)buddy)->prev; 223 node3 = ((GaimBlistNode*)buddy)->prev;
219 224
220 if (node2) 225 if (node2)
221 node2->prev = node3; 226 node2->prev = node3;
222 if (node3) 227 if (node3)
223 node3->next = node2; 228 node3->next = node2;
224 229
225 if (((GaimBlistNode*)buddy)->parent != n->parent) 230 if (((GaimBlistNode*)buddy)->parent != n->parent)
226 serv_move_buddy(buddy, (struct group*)((GaimBlistNode*)buddy)->parent, 231 serv_move_buddy(buddy, (struct group*)((GaimBlistNode*)buddy)->parent,
227 (struct group*)n->parent); 232 (struct group*)n->parent);
228 save = TRUE; 233 save = TRUE;
229 } 234 }
230 235
231 if (n) { 236 if (n) {
240 ((GaimBlistNode*)buddy)->parent = (GaimBlistNode*)g; 245 ((GaimBlistNode*)buddy)->parent = (GaimBlistNode*)g;
241 } 246 }
242 247
243 if (ops) 248 if (ops)
244 ops->update(gaimbuddylist, (GaimBlistNode*)buddy); 249 ops->update(gaimbuddylist, (GaimBlistNode*)buddy);
245 if (save) 250 if (save)
246 gaim_blist_save(); 251 gaim_blist_save();
247 } 252 }
248 253
249 struct group *gaim_group_new(const char *name) 254 struct group *gaim_group_new(const char *name)
250 { 255 {