summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2012-03-21 14:10:51 +0000
committerWill Thompson <will.thompson@collabora.co.uk>2012-03-21 14:11:50 +0000
commit5b8e9996cef7291640ddc5fccdd6381da371fb72 (patch)
tree8e35fc4331ad52ce7943cbe81babff57a703b198
parent5cf27e1109d98c2176c3369c3ab7143c996329f0 (diff)
downloadtelepathy-glib-5b8e9996cef7291640ddc5fccdd6381da371fb72.tar.gz
example approver: use _close_channels_async()
-rw-r--r--examples/client/approver.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/examples/client/approver.c b/examples/client/approver.c
index 35cfc952a..bc0564eb7 100644
--- a/examples/client/approver.c
+++ b/examples/client/approver.c
@@ -51,32 +51,22 @@ handle_with_cb (GObject *source,
}
static void
-claim_cb (GObject *source,
+close_cb (GObject *source,
GAsyncResult *result,
gpointer user_data)
{
TpChannelDispatchOperation *cdo = TP_CHANNEL_DISPATCH_OPERATION (source);
GError *error;
- GPtrArray *channels;
- guint i;
- if (!tp_channel_dispatch_operation_claim_with_finish (cdo, result, &error))
+ if (!tp_channel_dispatch_operation_close_channels_finish (cdo, result, &error))
{
- g_print ("Claim() failed: %s\n", error->message);
+ g_print ("Rejecting channels failed: %s\n", error->message);
g_error_free (error);
return;
}
- g_print ("Claim() succeeded, close channels\n");
-
- channels = tp_channel_dispatch_operation_borrow_channels (cdo);
- for (i = 0; i < channels->len; i++)
- {
- TpChannel *channel = g_ptr_array_index (channels, i);
-
- tp_cli_channel_call_close (channel, -1, NULL, NULL, NULL, NULL);
- }
+ g_print ("Rejected all the things!\n");
}
@@ -139,8 +129,7 @@ add_dispatch_operation_cb (TpSimpleApprover *self,
{
g_print ("Dissaprove channels\n");
- tp_channel_dispatch_operation_claim_with_async (cdo,
- TP_BASE_CLIENT (self), claim_cb, NULL);
+ tp_channel_dispatch_operation_close_channels_async (cdo, close_cb, NULL);
}
else
{