comparison src/server.c @ 10853:2409700be3dc

[gaim-migrate @ 12527] (15:46:50) LSchiere2: grim: commit message? (15:47:01) grim: LSchiere2: whatever..[sic] grim fixed a crash and some oddness in renaming groups. a related patch went into oldstatus a while back (also from grim). This is the HEAD version, removing a server.[ch] function in the process. committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Tue, 19 Apr 2005 19:48:29 +0000
parents fa06fda62868
children 6240d7fd5b2c
comparison
equal deleted inserted replaced
10852:62b5117114d2 10853:2409700be3dc
379 prpl_info->group_buddy(b->account->gc, b->name, og->name, ng->name); 379 prpl_info->group_buddy(b->account->gc, b->name, og->name, ng->name);
380 } 380 }
381 } 381 }
382 } 382 }
383 383
384 /*
385 * Rename a group on server roster/list.
386 */
387 void serv_rename_group(GaimConnection *gc, const char *old_name,
388 GaimGroup *group, GList *moved_buddies)
389 {
390 GaimPluginProtocolInfo *prpl_info = NULL;
391
392 if (gc != NULL && gc->prpl != NULL)
393 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl);
394
395 if (prpl_info && old_name && group && strcmp(old_name, group->name)) {
396 if (prpl_info->rename_group) {
397 /* prpl's might need to check if the group already
398 * exists or not, and handle that differently */
399 prpl_info->rename_group(gc, old_name, group, moved_buddies);
400 } else {
401 GList *cur, *groups = NULL;
402
403 /* Make a list of what the groups each buddy is in */
404 for (cur = moved_buddies; cur != NULL; cur = cur->next) {
405 GaimBlistNode *node = cur->data;
406 groups = g_list_append(groups, node->parent->parent);
407 }
408
409 serv_remove_buddies(gc, moved_buddies, groups);
410 g_list_free(groups);
411 serv_add_buddies(gc, moved_buddies);
412 }
413 }
414 }
415
416 void serv_add_permit(GaimConnection *g, const char *name) 384 void serv_add_permit(GaimConnection *g, const char *name)
417 { 385 {
418 GaimPluginProtocolInfo *prpl_info = NULL; 386 GaimPluginProtocolInfo *prpl_info = NULL;
419 387
420 if (g != NULL && g->prpl != NULL) 388 if (g != NULL && g->prpl != NULL)