diff options
| author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2014-01-17 15:13:06 +0100 |
|---|---|---|
| committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2014-01-20 15:01:08 +0100 |
| commit | 320866e634f3eb59334815572aa65e082fcf2126 (patch) | |
| tree | 8cb0b5f72880965bd897964bbbd0797d4eba4b74 | |
| parent | 2d0d57116718d9a9ac6d6cbc550697a355f95a3f (diff) | |
HandleWithTime() has been removed
| -rw-r--r-- | docs/reference/telepathy-glib/telepathy-glib-sections.txt | 7 | ||||
| -rw-r--r-- | examples/client/approver.c | 2 | ||||
| -rw-r--r-- | telepathy-glib/channel-dispatch-operation.c | 86 | ||||
| -rw-r--r-- | telepathy-glib/channel-dispatch-operation.h | 13 | ||||
| -rw-r--r-- | tests/dbus/channel-dispatch-operation.c | 34 | ||||
| -rw-r--r-- | tests/lib/simple-channel-dispatch-operation.c | 12 |
6 files changed, 11 insertions, 143 deletions
diff --git a/docs/reference/telepathy-glib/telepathy-glib-sections.txt b/docs/reference/telepathy-glib/telepathy-glib-sections.txt index 57c3c944c..8a31be931 100644 --- a/docs/reference/telepathy-glib/telepathy-glib-sections.txt +++ b/docs/reference/telepathy-glib/telepathy-glib-sections.txt @@ -4227,8 +4227,6 @@ tp_cli_channel_dispatch_operation_callback_for_claim tp_cli_channel_dispatch_operation_call_claim tp_cli_channel_dispatch_operation_callback_for_handle_with tp_cli_channel_dispatch_operation_call_handle_with -tp_cli_channel_dispatch_operation_callback_for_handle_with_time -tp_cli_channel_dispatch_operation_call_handle_with_time tp_cli_channel_dispatch_operation_signal_callback_finished tp_cli_channel_dispatch_operation_connect_to_finished <SUBSECTION Standard> @@ -4310,8 +4308,6 @@ tp_channel_dispatch_operation_get_connection tp_channel_dispatch_operation_get_possible_handlers tp_channel_dispatch_operation_handle_with_async tp_channel_dispatch_operation_handle_with_finish -tp_channel_dispatch_operation_handle_with_time_async -tp_channel_dispatch_operation_handle_with_time_finish tp_channel_dispatch_operation_claim_with_async tp_channel_dispatch_operation_claim_with_finish tp_channel_dispatch_operation_close_channel_async @@ -4370,9 +4366,6 @@ tp_svc_channel_dispatch_operation_implement_claim tp_svc_channel_dispatch_operation_return_from_handle_with tp_svc_channel_dispatch_operation_handle_with_impl tp_svc_channel_dispatch_operation_implement_handle_with -tp_svc_channel_dispatch_operation_handle_with_time_impl -tp_svc_channel_dispatch_operation_implement_handle_with_time -tp_svc_channel_dispatch_operation_return_from_handle_with_time tp_svc_channel_dispatch_operation_emit_finished <SUBSECTION Standard> tp_svc_channel_dispatch_operation_get_type diff --git a/examples/client/approver.c b/examples/client/approver.c index b9b5b28c5..3bbc4de24 100644 --- a/examples/client/approver.c +++ b/examples/client/approver.c @@ -122,7 +122,7 @@ add_dispatch_operation_cb (TpSimpleApprover *self, g_print ("Approve channel\n"); tp_channel_dispatch_operation_handle_with_async (cdo, NULL, - handle_with_cb, NULL); + TP_USER_ACTION_TIME_CURRENT_TIME, handle_with_cb, NULL); } else if (c == 'n' || c == 'N') { diff --git a/telepathy-glib/channel-dispatch-operation.c b/telepathy-glib/channel-dispatch-operation.c index a13efd716..386ab3d54 100644 --- a/telepathy-glib/channel-dispatch-operation.c +++ b/telepathy-glib/channel-dispatch-operation.c @@ -937,76 +937,6 @@ handle_with_cb (TpChannelDispatchOperation *self, * @handler: (allow-none): The well-known bus name (starting with * #TP_CLIENT_BUS_NAME_BASE) of the channel handler that should handle the * channel, or %NULL if the client has no preferred channel handler - * @callback: a callback to call when the call returns - * @user_data: data to pass to @callback - * - * Called by an approver to accept a channel bundle and request that the - * given handler be used to handle it. - * - * If successful, this method will cause the #TpProxy::invalidated signal - * to be emitted with the TP_DBUS_ERROR_OBJECT_REMOVED error code. - * - * However, this method may fail because the dispatch has already been - * completed and the object has already gone. If this occurs, it indicates - * that another approver has asked for the bundle to be handled by a - * particular handler. The approver MUST NOT attempt to interact with - * the channel further in this case, unless it is separately - * invoked as the handler. - * - * Approvers which are also channel handlers SHOULD use - * tp_channel_dispatch_operation_claim_with_async() instead - * of tp_channel_dispatch_operation_handle_with_async() to request - * that they can handle a channel bundle themselves. - * - * Since: 0.11.5 - */ -void -tp_channel_dispatch_operation_handle_with_async ( - TpChannelDispatchOperation *self, - const gchar *handler, - GAsyncReadyCallback callback, - gpointer user_data) -{ - GSimpleAsyncResult *result; - - g_return_if_fail (TP_IS_CHANNEL_DISPATCH_OPERATION (self)); - - result = g_simple_async_result_new (G_OBJECT (self), - callback, user_data, tp_channel_dispatch_operation_handle_with_async); - - tp_cli_channel_dispatch_operation_call_handle_with (self, -1, - handler != NULL ? handler: "", - handle_with_cb, result, NULL, G_OBJECT (self)); -} - -/** - * tp_channel_dispatch_operation_handle_with_finish: - * @self: a #TpChannelDispatchOperation - * @result: a #GAsyncResult - * @error: a #GError to fill - * - * Finishes an async call to HandleWith(). - * - * Returns: %TRUE if the HandleWith() call was successful, otherwise %FALSE - * - * Since: 0.11.5 - */ -gboolean -tp_channel_dispatch_operation_handle_with_finish ( - TpChannelDispatchOperation *self, - GAsyncResult *result, - GError **error) -{ - _tp_implement_finish_void (self, - tp_channel_dispatch_operation_handle_with_async); -} - -/** - * tp_channel_dispatch_operation_handle_with_time_async: - * @self: a #TpChannelDispatchOperation - * @handler: (allow-none): The well-known bus name (starting with - * #TP_CLIENT_BUS_NAME_BASE) of the channel handler that should handle the - * channel, or %NULL if the client has no preferred channel handler * @user_action_time: the time at which user action occurred, or one of the * special values %TP_USER_ACTION_TIME_NOT_USER_ACTION or * %TP_USER_ACTION_TIME_CURRENT_TIME @@ -1027,11 +957,9 @@ tp_channel_dispatch_operation_handle_with_finish ( * %GDK_CURRENT_TIME). * * This method has been introduced in telepathy-mission-control 5.5.0. - * - * Since: 0.11.7 */ void -tp_channel_dispatch_operation_handle_with_time_async ( +tp_channel_dispatch_operation_handle_with_async ( TpChannelDispatchOperation *self, const gchar *handler, gint64 user_action_time, @@ -1044,15 +972,15 @@ tp_channel_dispatch_operation_handle_with_time_async ( result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, - tp_channel_dispatch_operation_handle_with_time_async); + tp_channel_dispatch_operation_handle_with_async); - tp_cli_channel_dispatch_operation_call_handle_with_time (self, -1, + tp_cli_channel_dispatch_operation_call_handle_with (self, -1, handler != NULL ? handler: "", user_action_time, handle_with_cb, result, NULL, G_OBJECT (self)); } /** - * tp_channel_dispatch_operation_handle_with_time_finish: + * tp_channel_dispatch_operation_handle_with_finish: * @self: a #TpChannelDispatchOperation * @result: a #GAsyncResult * @error: a #GError to fill @@ -1060,17 +988,15 @@ tp_channel_dispatch_operation_handle_with_time_async ( * Finishes an async call to HandleWithTime(). * * Returns: %TRUE if the HandleWithTime() call was successful, otherwise %FALSE - * - * Since: 0.11.7 */ gboolean - tp_channel_dispatch_operation_handle_with_time_finish ( + tp_channel_dispatch_operation_handle_with_finish ( TpChannelDispatchOperation *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, - tp_channel_dispatch_operation_handle_with_time_async); + tp_channel_dispatch_operation_handle_with_async); } static void diff --git a/telepathy-glib/channel-dispatch-operation.h b/telepathy-glib/channel-dispatch-operation.h index 0b7ddf372..6c563336e 100644 --- a/telepathy-glib/channel-dispatch-operation.h +++ b/telepathy-glib/channel-dispatch-operation.h @@ -100,22 +100,11 @@ GStrv tp_channel_dispatch_operation_get_possible_handlers ( void tp_channel_dispatch_operation_handle_with_async ( TpChannelDispatchOperation *self, const gchar *handler, - GAsyncReadyCallback callback, - gpointer user_data); - -gboolean tp_channel_dispatch_operation_handle_with_finish ( - TpChannelDispatchOperation *self, - GAsyncResult *result, - GError **error); - -void tp_channel_dispatch_operation_handle_with_time_async ( - TpChannelDispatchOperation *self, - const gchar *handler, gint64 user_action_time, GAsyncReadyCallback callback, gpointer user_data); -gboolean tp_channel_dispatch_operation_handle_with_time_finish ( +gboolean tp_channel_dispatch_operation_handle_with_finish ( TpChannelDispatchOperation *self, GAsyncResult *result, GError **error); diff --git a/tests/dbus/channel-dispatch-operation.c b/tests/dbus/channel-dispatch-operation.c index 9f278e4b9..41473b22d 100644 --- a/tests/dbus/channel-dispatch-operation.c +++ b/tests/dbus/channel-dispatch-operation.c @@ -503,13 +503,13 @@ test_handle_with (Test *test, g_assert_no_error (test->error); tp_channel_dispatch_operation_handle_with_async (test->cdo, - NULL, handle_with_cb, test); + NULL, TP_USER_ACTION_TIME_CURRENT_TIME, handle_with_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); tp_channel_dispatch_operation_handle_with_async (test->cdo, - "FAIL", handle_with_cb, test); + "FAIL", TP_USER_ACTION_TIME_CURRENT_TIME, handle_with_cb, test); g_main_loop_run (test->mainloop); g_assert_error (test->error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT); @@ -517,34 +517,6 @@ test_handle_with (Test *test, } static void -handle_with_time_cb (GObject *source, - GAsyncResult *result, - gpointer user_data) -{ - Test *test = user_data; - - tp_channel_dispatch_operation_handle_with_time_finish ( - TP_CHANNEL_DISPATCH_OPERATION (source), result, &test->error); - - g_main_loop_quit (test->mainloop); -} - -static void -test_handle_with_time (Test *test, - gconstpointer data G_GNUC_UNUSED) -{ - test->cdo = dispatch_operation_new (test->dbus, - "/whatever", NULL, &test->error); - g_assert_no_error (test->error); - - tp_channel_dispatch_operation_handle_with_time_async (test->cdo, - NULL, 666, handle_with_time_cb, test); - g_main_loop_run (test->mainloop); - - g_assert_no_error (test->error); -} - -static void close_channels_cb (GObject *source, GAsyncResult *result, gpointer user_data) @@ -686,8 +658,6 @@ main (int argc, test_properties_fetched, teardown_services); g_test_add ("/cdo/handle-with", Test, NULL, setup_services, test_handle_with, teardown_services); - g_test_add ("/cdo/handle-with-time", Test, NULL, setup_services, - test_handle_with_time, teardown_services); g_test_add ("/cdo/close-channel", Test, NULL, setup_services, test_close_channel, teardown_services); g_test_add ("/cdo/leave-channel", Test, NULL, setup_services, diff --git a/tests/lib/simple-channel-dispatch-operation.c b/tests/lib/simple-channel-dispatch-operation.c index baeff8672..bc95fc811 100644 --- a/tests/lib/simple-channel-dispatch-operation.c +++ b/tests/lib/simple-channel-dispatch-operation.c @@ -57,6 +57,7 @@ static void tp_tests_simple_channel_dispatch_operation_handle_with ( TpSvcChannelDispatchOperation *iface, const gchar *handler, + gint64 user_action_timestamp, DBusGMethodInvocation *context) { if (!tp_strdiff (handler, "FAIL")) @@ -81,16 +82,6 @@ tp_tests_simple_channel_dispatch_operation_claim ( } static void -tp_tests_simple_channel_dispatch_operation_handle_with_time ( - TpSvcChannelDispatchOperation *iface, - const gchar *handler, - gint64 user_action_timestamp, - DBusGMethodInvocation *context) -{ - dbus_g_method_return (context); -} - -static void channel_dispatch_operation_iface_init (gpointer klass, gpointer unused G_GNUC_UNUSED) { @@ -98,7 +89,6 @@ channel_dispatch_operation_iface_init (gpointer klass, klass, tp_tests_simple_channel_dispatch_operation_##x) IMPLEMENT(handle_with); IMPLEMENT(claim); - IMPLEMENT(handle_with_time); #undef IMPLEMENT } |
