summaryrefslogtreecommitdiff
path: root/telepathy-glib/simple-approver.c
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2010-08-17 16:22:28 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2010-08-17 16:32:09 +0100
commit268d6b533483b58e2820ef317af9f61e39ad117c (patch)
tree9f00625a7ccb30a9b45c45b232b83510188f709b /telepathy-glib/simple-approver.c
parent19addd90719704556e5ca3e515ad2d0afb41795d (diff)
downloadtelepathy-glib-268d6b533483b58e2820ef317af9f61e39ad117c.tar.gz
TpSimple(Approver|Handler|Observer): allow account-manager to be set
Diffstat (limited to 'telepathy-glib/simple-approver.c')
-rw-r--r--telepathy-glib/simple-approver.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/telepathy-glib/simple-approver.c b/telepathy-glib/simple-approver.c
index 53efde9cd..8e5e17b14 100644
--- a/telepathy-glib/simple-approver.c
+++ b/telepathy-glib/simple-approver.c
@@ -270,6 +270,8 @@ tp_simple_approver_class_init (TpSimpleApproverClass *cls)
* is destroyed
*
* Convenient function to create a new #TpSimpleApprover instance.
+ * If you have a particular #TpAccountManager that you want to use,
+ * call tp_simple_handler_new_with_am() instead.
*
* Returns: (type TelepathyGLib.SimpleApprover): a new #TpSimpleApprover
*
@@ -292,3 +294,38 @@ tp_simple_approver_new (TpDBusDaemon *dbus,
"destroy", destroy,
NULL);
}
+
+/**
+ * tp_simple_approver_new_with_am:
+ * @account_manager: an account manager, which may not be %NULL
+ * @name: the name of the Approver (see #TpBaseClient:name: for details)
+ * @unique: the value of the TpBaseClient:uniquify-name: property
+ * @callback: the function called when ApproverChannels is called
+ * @user_data: arbitrary user-supplied data passed to @callback
+ * @destroy: called with the user_data as argument, when the #TpSimpleApprover
+ * is destroyed
+ *
+ * Convenient function to create a new #TpSimpleApprover instance with a
+ * specified #TpAccountManager.
+ *
+ * Returns: (type TelepathyGLib.SimpleApprover): a new #TpSimpleApprover
+ *
+ * Since: 0.11.UNRELEASED
+ */
+TpBaseClient *
+tp_simple_approver_new_with_am (TpAccountManager *account_manager,
+ const gchar *name,
+ gboolean unique,
+ TpSimpleApproverAddDispatchOperationImpl callback,
+ gpointer user_data,
+ GDestroyNotify destroy)
+{
+ return g_object_new (TP_TYPE_SIMPLE_APPROVER,
+ "account-manager", account_manager,
+ "name", name,
+ "uniquify-name", unique,
+ "callback", callback,
+ "user-data", user_data,
+ "destroy", destroy,
+ NULL);
+}