# HG changeset patch
# Node ID cb9cc168101b
# Parent  63639da06cbd
diff --git a/libpurple/purplecontactmanager.c b/libpurple/purplecontactmanager.c
--- a/libpurple/purplecontactmanager.c
+++ b/libpurple/purplecontactmanager.c
@@ -147,7 +147,8 @@
 		protocol = purple_account_get_protocol(account);
 		if(PURPLE_IS_PROTOCOL_ROSTER(protocol)) {
 			purple_protocol_roster_update_async(PURPLE_PROTOCOL_ROSTER(protocol),
-			                                    contact, NULL, NULL, NULL);
+			                                    account, contact, NULL, NULL,
+			                                    NULL);
 		}
 	}
 }
diff --git a/libpurple/purpleprotocolroster.h b/libpurple/purpleprotocolroster.h
--- a/libpurple/purpleprotocolroster.h
+++ b/libpurple/purpleprotocolroster.h
@@ -72,13 +72,13 @@
 	GTypeInterface parent;
 
 	/*< public >*/
-	void (*add_async)(PurpleProtocolRoster *roster, PurpleContact *contact, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer data);
+	void (*add_async)(PurpleProtocolRoster *roster, PurpleAccount *account, PurpleContact *contact, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer data);
 	gboolean (*add_finish)(PurpleProtocolRoster *roster, GAsyncResult *result, GError **error);
 
-	void (*update_async)(PurpleProtocolRoster *roster, PurpleContact *contact, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer data);
+	void (*update_async)(PurpleProtocolRoster *roster, PurpleAccount *account, PurpleContact *contact, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer data);
 	gboolean (*update_finish)(PurpleProtocolRoster *roster, GAsyncResult *result, GError **error);
 
-	void (*remove_async)(PurpleProtocolRoster *roster, PurpleContact *contact, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer data);
+	void (*remove_async)(PurpleProtocolRoster *roster, PurpleAccount *account, PurpleContact *contact, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer data);
 	gboolean (*remove_finish)(PurpleProtocolRoster *roster, GAsyncResult *result, GError **error);
 
 	/*< private >*/
@@ -90,6 +90,7 @@
 /**
  * purple_protocol_roster_add_async:
  * @roster: The instance.
+ * @account: The [class@Account] to use.
  * @contact: The [class@Contact] to add.
  * @cancellable: A [class@Gio.Cancellable].
  * @callback: A [callback@Gio.AsyncReadyCallback] to call when the request has
@@ -102,7 +103,7 @@
  *
  * Since: 3.0.0
  */
-void purple_protocol_roster_add_async(PurpleProtocolRoster *roster, PurpleContact *contact, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer data);
+void purple_protocol_roster_add_async(PurpleProtocolRoster *roster, PurpleAccount *account, PurpleContact *contact, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer data);
 
 /**
  * purple_protocol_roster_add_finish:
@@ -125,6 +126,7 @@
 /**
  * purple_protocol_roster_update_async:
  * @roster: The instance.
+ * @account: The [class@Account] to use.
  * @contact: The [class@Contact] to update.
  * @cancellable: A [class@Gio.Cancellable].
  * @callback: A [callback@Gio.AsyncReadyCallback] to call when the request has
@@ -142,7 +144,7 @@
  *
  * Since: 3.0.0
  */
-void purple_protocol_roster_update_async(PurpleProtocolRoster *roster, PurpleContact *contact, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer data);
+void purple_protocol_roster_update_async(PurpleProtocolRoster *roster, PurpleAccount *account, PurpleContact *contact, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer data);
 
 /**
  * purple_protocol_roster_update_finish:
@@ -165,6 +167,7 @@
 /**
  * purple_protocol_roster_remove_async:
  * @roster: The instance.
+ * @account: The [class@Account] to use.
  * @contact: The [class@Contact] to remove.
  * @cancellable: A [class@Gio.Cancellable].
  * @callback: A [callback@Gio.AsyncReadyCallback] to call when the request has
@@ -177,7 +180,7 @@
  *
  * Since: 3.0.0
  */
-void purple_protocol_roster_remove_async(PurpleProtocolRoster *roster, PurpleContact *contact, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer data);
+void purple_protocol_roster_remove_async(PurpleProtocolRoster *roster, PurpleAccount *account, PurpleContact *contact, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer data);
 
 /**
  * purple_protocol_roster_remove_finish:
diff --git a/libpurple/purpleprotocolroster.c b/libpurple/purpleprotocolroster.c
--- a/libpurple/purpleprotocolroster.c
+++ b/libpurple/purpleprotocolroster.c
@@ -38,6 +38,7 @@
  *****************************************************************************/
 void
 purple_protocol_roster_add_async(PurpleProtocolRoster *roster,
+                                 PurpleAccount *account,
                                  PurpleContact *contact,
                                  GCancellable *cancellable,
                                  GAsyncReadyCallback callback,
@@ -50,7 +51,8 @@
 
 	iface = PURPLE_PROTOCOL_ROSTER_GET_IFACE(roster);
 	if(iface != NULL && iface->add_async != NULL) {
-		iface->add_async(roster, contact, cancellable, callback, data);
+		iface->add_async(roster, account, contact, cancellable, callback,
+		                 data);
 	} else {
 		g_warning("%s does not implement the add_async method",
 		          G_OBJECT_TYPE_NAME(roster));
@@ -75,6 +77,7 @@
 
 void
 purple_protocol_roster_update_async(PurpleProtocolRoster *roster,
+                                    PurpleAccount *account,
                                     PurpleContact *contact,
                                     GCancellable *cancellable,
                                     GAsyncReadyCallback callback,
@@ -87,7 +90,8 @@
 
 	iface = PURPLE_PROTOCOL_ROSTER_GET_IFACE(roster);
 	if(iface != NULL && iface->update_async != NULL) {
-		iface->update_async(roster, contact, cancellable, callback, data);
+		iface->update_async(roster, account, contact, cancellable, callback,
+		                    data);
 	} else {
 		g_warning("%s does not implement the update_async method",
 		          G_OBJECT_TYPE_NAME(roster));
@@ -112,6 +116,7 @@
 
 void
 purple_protocol_roster_remove_async(PurpleProtocolRoster *roster,
+                                    PurpleAccount *account,
                                     PurpleContact *contact,
                                     GCancellable *cancellable,
                                     GAsyncReadyCallback callback,
@@ -124,7 +129,8 @@
 
 	iface = PURPLE_PROTOCOL_ROSTER_GET_IFACE(roster);
 	if(iface != NULL && iface->remove_async != NULL) {
-		iface->remove_async(roster, contact, cancellable, callback, data);
+		iface->remove_async(roster, account, contact, cancellable, callback,
+		                    data);
 	} else {
 		g_warning("%s does not implement the remove_async method",
 		          G_OBJECT_TYPE_NAME(roster));
diff --git a/libpurple/tests/test_protocol_roster.c b/libpurple/tests/test_protocol_roster.c
--- a/libpurple/tests/test_protocol_roster.c
+++ b/libpurple/tests/test_protocol_roster.c
@@ -96,11 +96,12 @@
 
 		account = purple_account_new("test", "test");
 		contact = purple_contact_new(account, NULL);
-		g_clear_object(&account);
 
-		purple_protocol_roster_add_async(roster, contact, NULL, NULL, NULL);
+		purple_protocol_roster_add_async(roster, account, contact, NULL, NULL,
+		                                 NULL);
 
 		g_clear_object(&roster);
+		g_clear_object(&account);
 		g_clear_object(&contact);
 	}
 
@@ -120,11 +121,12 @@
 
 		account = purple_account_new("test", "test");
 		contact = purple_contact_new(account, NULL);
-		g_clear_object(&account);
 
-		purple_protocol_roster_update_async(roster, contact, NULL, NULL, NULL);
+		purple_protocol_roster_update_async(roster, account, contact, NULL,
+		                                    NULL, NULL);
 
 		g_clear_object(&roster);
+		g_clear_object(&account);
 		g_clear_object(&contact);
 	}
 
@@ -144,11 +146,12 @@
 
 		account = purple_account_new("test", "test");
 		contact = purple_contact_new(account, NULL);
-		g_clear_object(&account);
 
-		purple_protocol_roster_remove_async(roster, contact, NULL, NULL, NULL);
+		purple_protocol_roster_remove_async(roster, account, contact, NULL,
+		                                    NULL, NULL);
 
 		g_clear_object(&roster);
+		g_clear_object(&account);
 		g_clear_object(&contact);
 	}
 
@@ -177,6 +180,7 @@
 
 static void
 test_purple_protocol_roster_add_async(PurpleProtocolRoster *r,
+                                      G_GNUC_UNUSED PurpleAccount *account,
                                       G_GNUC_UNUSED PurpleContact *contact,
                                       GCancellable *cancellable,
                                       GAsyncReadyCallback callback,
@@ -212,6 +216,7 @@
 
 static void
 test_purple_protocol_roster_update_async(PurpleProtocolRoster *r,
+                                         G_GNUC_UNUSED PurpleAccount *account,
                                          G_GNUC_UNUSED PurpleContact *contact,
                                          GCancellable *cancellable,
                                          GAsyncReadyCallback callback,
@@ -247,6 +252,7 @@
 
 static void
 test_purple_protocol_roster_remove_async(PurpleProtocolRoster *r,
+                                         G_GNUC_UNUSED PurpleAccount *account,
                                          G_GNUC_UNUSED PurpleContact *contact,
                                          GCancellable *cancellable,
                                          GAsyncReadyCallback callback,
@@ -341,12 +347,13 @@
 
 	account = purple_account_new("test", "test");
 	contact = purple_contact_new(account, NULL);
-	g_clear_object(&account);
 
-	purple_protocol_roster_add_async(roster, contact, NULL,
+	purple_protocol_roster_add_async(roster, account, contact, NULL,
 	                                 test_purple_protocol_roster_add_cb,
 	                                 contact);
 
+	g_clear_object(&account);
+
 	return G_SOURCE_REMOVE;
 }
 
@@ -429,12 +436,13 @@
 
 	account = purple_account_new("test", "test");
 	contact = purple_contact_new(account, NULL);
-	g_clear_object(&account);
 
-	purple_protocol_roster_update_async(roster, contact, NULL,
+	purple_protocol_roster_update_async(roster, account, contact, NULL,
 	                                    test_purple_protocol_roster_update_cb,
 	                                    contact);
 
+	g_clear_object(&account);
+
 	return G_SOURCE_REMOVE;
 }
 
@@ -517,12 +525,13 @@
 
 	account = purple_account_new("test", "test");
 	contact = purple_contact_new(account, NULL);
-	g_clear_object(&account);
 
-	purple_protocol_roster_remove_async(roster, contact, NULL,
+	purple_protocol_roster_remove_async(roster, account, contact, NULL,
 	                                    test_purple_protocol_roster_remove_cb,
 	                                    contact);
 
+	g_clear_object(&account);
+
 	return G_SOURCE_REMOVE;
 }
 
