# HG changeset patch
# Node ID 0d3948d2ecce
# Parent  2dce52f93848
diff --git a/libpurple/account.c b/libpurple/account.c
--- a/libpurple/account.c
+++ b/libpurple/account.c
@@ -1826,23 +1826,20 @@
 	PurpleProtocol *protocol = NULL;
 	PurpleConnection *gc = purple_account_get_connection(account);
 
-	if (gc != NULL)
+	if(gc != NULL) {
 		protocol = purple_connection_get_protocol(gc);
+	}
 
-	if (protocol) {
-		GList *groups;
+	if(PURPLE_IS_PROTOCOL_SERVER(protocol)) {
+		PurpleProtocolServer *server = PURPLE_PROTOCOL_SERVER(protocol);
 
-		/* Make a list of what group each buddy is in */
-		groups = g_list_copy_deep(buddies,
-		                          (GCopyFunc)(GCallback)purple_buddy_get_group,
-		                          NULL);
+		for(GList *b = buddies; b != NULL; b = b->next) {
+			PurpleBuddy *buddy = b->data;
 
-		if(PURPLE_IS_PROTOCOL_SERVER(protocol)) {
-			purple_protocol_server_add_buddies(PURPLE_PROTOCOL_SERVER(protocol),
-			                                   gc, buddies, groups, message);
+			purple_protocol_server_add_buddy(server, gc, buddy,
+			                                 purple_buddy_get_group(buddy),
+			                                 message);
 		}
-
-		g_list_free(groups);
 	}
 }
 
diff --git a/libpurple/purpleprotocolserver.h b/libpurple/purpleprotocolserver.h
--- a/libpurple/purpleprotocolserver.h
+++ b/libpurple/purpleprotocolserver.h
@@ -98,7 +98,6 @@
 	void (*change_passwd)(PurpleProtocolServer *protocol_server, PurpleConnection *connection, const gchar *old_pass, const gchar *new_pass);
 
 	void (*add_buddy)(PurpleProtocolServer *protocol_server, PurpleConnection *connection, PurpleBuddy *buddy, PurpleGroup *group, const gchar *message);
-	void (*add_buddies)(PurpleProtocolServer *protocol_server, PurpleConnection *connection, GList *buddies, GList *groups, const gchar *message);
 	void (*remove_buddy)(PurpleProtocolServer *protocol_server, PurpleConnection *connection, PurpleBuddy *buddy, PurpleGroup *group);
 	void (*remove_buddies)(PurpleProtocolServer *protocol_server, PurpleConnection *connection, GList *buddies, GList *groups);
 
@@ -202,24 +201,6 @@
 void purple_protocol_server_add_buddy(PurpleProtocolServer *protocol_server, PurpleConnection *connection, PurpleBuddy *buddy, PurpleGroup *group, const gchar *message);
 
 /**
- * purple_protocol_server_add_buddies:
- * @protocol_server: The #PurpleProtocolServer instance.
- * @connection: The #PurpleConnection instance.
- * @buddies: (element-type PurpleBuddy): A #GList of #PurpleBuddy's to add.
- * @groups: (element-type PurpleGroup): A #GList of #PurpleGroup's that
- *          correspond to the @buddies parameter.
- * @message: An optional invite message to send.
- *
- * Similar to purple_protocol_server_add_buddy() but can add multiple buddies
- * at a time. If @protocol_server does not implement this function, this will
- * call purple_protocol_server_add_buddy() for each buddy/group pair in
- * @buddies/@groups.
- *
- * Since: 3.0.0
- */
-void purple_protocol_server_add_buddies(PurpleProtocolServer *protocol_server, PurpleConnection *connection, GList *buddies, GList *groups, const gchar *message);
-
-/**
  * purple_protocol_server_remove_buddy:
  * @protocol_server: The #PurpleProtocolServer instance.
  * @connection: The #PurpleConnection instance.
diff --git a/libpurple/purpleprotocolserver.c b/libpurple/purpleprotocolserver.c
--- a/libpurple/purpleprotocolserver.c
+++ b/libpurple/purpleprotocolserver.c
@@ -138,35 +138,6 @@
 }
 
 void
-purple_protocol_server_add_buddies(PurpleProtocolServer *protocol_server,
-                                   PurpleConnection *connection,
-                                   GList *buddies, GList *groups,
-                                   const gchar *message)
-{
-	PurpleProtocolServerInterface *iface = NULL;
-
-	g_return_if_fail(PURPLE_IS_PROTOCOL_SERVER(protocol_server));
-	g_return_if_fail(PURPLE_IS_CONNECTION(connection));
-	g_return_if_fail(g_list_length(buddies) != g_list_length(groups));
-
-	iface = PURPLE_PROTOCOL_SERVER_GET_IFACE(protocol_server);
-	if(iface != NULL && iface->add_buddies != NULL) {
-		iface->add_buddies(protocol_server, connection, buddies, groups,
-		                   message);
-	} else {
-		while(buddies != NULL && groups != NULL) {
-			purple_protocol_server_add_buddy(protocol_server, connection,
-			                                 PURPLE_BUDDY(buddies->data),
-			                                 PURPLE_GROUP(groups->data),
-			                                 message);
-
-			buddies = g_list_next(buddies);
-			groups = g_list_next(groups);
-		}
-	}
-}
-
-void
 purple_protocol_server_remove_buddy(PurpleProtocolServer *protocol_server,
                                     PurpleConnection *connection,
                                     PurpleBuddy *buddy, PurpleGroup *group)
