diff src/dialogs.c @ 5346:c1e7c3f72128

[gaim-migrate @ 5722] I think this group rename code is eleventy billion times better than the old stuff. better in such a way that it shouldn't crash, shouldn't leak memory, and shouldn't pain anyone's soul to look at. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sat, 10 May 2003 17:32:05 +0000
parents 1f901484599d
children 57b2986b62c3
line wrap: on
line diff
--- a/src/dialogs.c	Sat May 10 15:33:48 2003 +0000
+++ b/src/dialogs.c	Sat May 10 17:32:05 2003 +0000
@@ -4276,38 +4276,13 @@
 	const char *new_name;
 	struct group *g;
 	struct group *orig;
-	GSList *accts;
 
 	if (resp == GTK_RESPONSE_OK) {
-
 		new_name = gtk_entry_get_text(GTK_ENTRY(entry));
 		g = g_object_get_data(G_OBJECT(entry), "group");
 
-		if (new_name && (strlen(new_name) != 0) && strcmp(new_name, g->name)) {
-			char *prevname;
-	
-			if ((orig = gaim_find_group(new_name)) != NULL && gaim_utf8_strcasecmp(new_name, g->name)) {
-				gaim_blist_rename_group(orig, g->name);
-				accts = gaim_group_get_accounts(g);
-				while(accts) {
-					struct gaim_account *account = accts->data;
-					serv_rename_group(account->gc, g, new_name);
-					accts = g_slist_remove(accts, accts->data);
-				}
-				g_free(g);
-			} else {
-				prevname = g_strdup(g->name);
-				accts = gaim_group_get_accounts(g);
-				while(accts) {
-					struct gaim_account *account = accts->data;
-					serv_rename_group(account->gc, g, new_name);
-					accts = g_slist_remove(accts, accts->data);
-				}
-				gaim_blist_rename_group(g, new_name);
-				g_free(prevname);
-			}
-			gaim_blist_save();
-		}
+		gaim_blist_rename_group(g, new_name);
+		gaim_blist_save();
 	}
 	destroy_dialog(rename_dialog, rename_dialog);
 }