diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2013-02-13 15:01:54 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2013-09-10 11:34:42 +0100 |
commit | a9afabf2a6219f27038b34e29d36cc20dd2965eb (patch) | |
tree | 6d4b869a4e29678194fbd7e99c18c9c306bc9c3f | |
parent | 9becae7459f2762217f08eadc53ac0f9a85ab693 (diff) | |
download | telepathy-mission-control-a9afabf2a6219f27038b34e29d36cc20dd2965eb.tar.gz |
Deprecate mcp_dispatch_operation_leave_channels
It was designed for StreamedMedia, and is the wrong thing for Call.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55391
Reviewed-by: Xavier Claessens <xavier.claessens@collabora.co.uk>
-rw-r--r-- | mission-control-plugins/dispatch-operation.c | 16 | ||||
-rw-r--r-- | mission-control-plugins/dispatch-operation.h | 4 | ||||
-rw-r--r-- | tests/twisted/mcp-plugin.c | 5 |
3 files changed, 25 insertions, 0 deletions
diff --git a/mission-control-plugins/dispatch-operation.c b/mission-control-plugins/dispatch-operation.c index 27a8befc..ab51eb98 100644 --- a/mission-control-plugins/dispatch-operation.c +++ b/mission-control-plugins/dispatch-operation.c @@ -295,6 +295,16 @@ mcp_dispatch_operation_end_delay (McpDispatchOperation *self, * * Leave all channels in this bundle by using RemoveMembersWithReason if the * channel has the Group interface, or Close if not. + * + * This method was intended for StreamedMedia channels, which (ab)used the + * Group interface for call control. StreamedMedia channels have been + * superseded by Call channels, which have a proper "hang up" method which + * should be used instead. + * + * Deprecated: 5.15.UNRELEASED: Use tp_call_channel_hangup_async() to + * hang up Call channels, mcp_dispatch_operation_close_channels() to close + * generic channels, or mcp_dispatch_operation_destroy_channels() to + * terminate the channel destructively. */ void mcp_dispatch_operation_leave_channels (McpDispatchOperation *self, @@ -320,6 +330,9 @@ mcp_dispatch_operation_leave_channels (McpDispatchOperation *self, * (usually recommended), wait for Observers to reply first * * Close all channels in this bundle by using the Close D-Bus method. + * + * Plugins that terminate an audio or audio/video call should + * use tp_call_channel_hangup_async() instead. */ void mcp_dispatch_operation_close_channels (McpDispatchOperation *self, @@ -340,6 +353,9 @@ mcp_dispatch_operation_close_channels (McpDispatchOperation *self, * * Close all channels in this bundle destructively, by using the Destroy D-Bus * method if implemented, or the Close D-Bus method if not. + * + * Plugins that terminate an audio or audio/video call should + * use tp_call_channel_hangup_async() instead. */ void mcp_dispatch_operation_destroy_channels (McpDispatchOperation *self, diff --git a/mission-control-plugins/dispatch-operation.h b/mission-control-plugins/dispatch-operation.h index 7cb4dd64..5ad12d9b 100644 --- a/mission-control-plugins/dispatch-operation.h +++ b/mission-control-plugins/dispatch-operation.h @@ -85,9 +85,13 @@ McpDispatchOperationDelay *mcp_dispatch_operation_start_delay ( void mcp_dispatch_operation_end_delay (McpDispatchOperation *self, McpDispatchOperationDelay *delay); +#ifndef MC_DISABLE_DEPRECATED +G_DEPRECATED_FOR (mcp_dispatch_operation_close_channels or tp_call_channel_hangup_async) void mcp_dispatch_operation_leave_channels (McpDispatchOperation *self, gboolean wait_for_observers, TpChannelGroupChangeReason reason, const gchar *message); +#endif + void mcp_dispatch_operation_close_channels (McpDispatchOperation *self, gboolean wait_for_observers); void mcp_dispatch_operation_destroy_channels (McpDispatchOperation *self, diff --git a/tests/twisted/mcp-plugin.c b/tests/twisted/mcp-plugin.c index 1c536665..7d347b11 100644 --- a/tests/twisted/mcp-plugin.c +++ b/tests/twisted/mcp-plugin.c @@ -19,6 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#undef MC_DISABLE_DEPRECATED #include "config.h" #include <mission-control-plugins/mission-control-plugins.h> @@ -136,9 +137,11 @@ permission_cb (DBusPendingCall *pc, } else { + G_GNUC_BEGIN_IGNORE_DEPRECATIONS mcp_dispatch_operation_leave_channels (ctx->dispatch_operation, TRUE, TP_CHANNEL_GROUP_CHANGE_REASON_PERMISSION_DENIED, "Computer says no"); + G_GNUC_END_IGNORE_DEPRECATIONS } } else @@ -511,9 +514,11 @@ test_rejection_plugin_check_cdo (McpDispatchOperationPolicy *policy, else if (!tp_strdiff (target_id, "mc.hammer@example.net")) { DEBUG ("MC Hammer detected, leaving channels when observers have run"); + G_GNUC_BEGIN_IGNORE_DEPRECATIONS mcp_dispatch_operation_leave_channels (dispatch_operation, TRUE, TP_CHANNEL_GROUP_CHANGE_REASON_PERMISSION_DENIED, "Can't touch this"); + G_GNUC_END_IGNORE_DEPRECATIONS } g_hash_table_unref (properties); |