diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2019-07-02 17:53:25 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2019-07-11 23:21:00 +0200 |
commit | 511b0ff2442f26257be442963ac833f5ba06f80c (patch) | |
tree | 8ce57d58f35f162ebb5d3a5be23cbabc51c20a67 /libmm-glib | |
parent | 6f235192393fbc345bf79bcf8205d7279f584f91 (diff) |
api,call: new JoinMultiparty() and LeaveMultiparty() methods
Diffstat (limited to 'libmm-glib')
-rw-r--r-- | libmm-glib/mm-call.c | 150 | ||||
-rw-r--r-- | libmm-glib/mm-call.h | 25 |
2 files changed, 175 insertions, 0 deletions
diff --git a/libmm-glib/mm-call.c b/libmm-glib/mm-call.c index 1ee624e2..91439f5a 100644 --- a/libmm-glib/mm-call.c +++ b/libmm-glib/mm-call.c @@ -592,6 +592,156 @@ mm_call_deflect_sync (MMCall *self, error); } +/*****************************************************************************/ + +/** + * mm_call_join_multiparty_finish: + * @self: A #MMCall. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to mm_call_join_multiparty(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with mm_call_join_multiparty(). + * + * Returns: %TRUE if the operation succeeded, %FALSE if @error is set. + */ +gboolean +mm_call_join_multiparty_finish (MMCall *self, + GAsyncResult *res, + GError **error) +{ + g_return_val_if_fail (MM_IS_CALL (self), FALSE); + + return mm_gdbus_call_call_join_multiparty_finish (MM_GDBUS_CALL (self), res, error); +} + +/** + * mm_call_join_multiparty: + * @self: A #MMCall. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Synchronously requests to join this call into a multiparty call. + * + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call mm_call_join_multiparty_finish() to get the result of the operation. + * + * See mm_call_join_multiparty_sync() for the synchronous, blocking version of this method. + */ +void +mm_call_join_multiparty (MMCall *self, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_return_if_fail (MM_IS_CALL (self)); + + mm_gdbus_call_call_join_multiparty (MM_GDBUS_CALL (self), + cancellable, + callback, + user_data); +} + +/** + * mm_call_join_multiparty_sync: + * @self: A #MMCall.g + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously requests to join this call into a multiparty call. + * + * The calling thread is blocked until an incoming call is ready. + * See mm_call_join_multiparty() for the asynchronous version of this method. + * + * Returns: %TRUE if the operation succeeded, %FALSE if @error is set. + */ +gboolean +mm_call_join_multiparty_sync (MMCall *self, + GCancellable *cancellable, + GError **error) +{ + g_return_val_if_fail (MM_IS_CALL (self), FALSE); + + return mm_gdbus_call_call_join_multiparty_sync (MM_GDBUS_CALL (self), + cancellable, + error); +} + +/** + * mm_call_leave_multiparty_finish: + * @self: A #MMCall. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to mm_call_leave_multiparty(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with mm_call_leave_multiparty(). + * + * Returns: %TRUE if the operation succeeded, %FALSE if @error is set. + */ +gboolean +mm_call_leave_multiparty_finish (MMCall *self, + GAsyncResult *res, + GError **error) +{ + g_return_val_if_fail (MM_IS_CALL (self), FALSE); + + return mm_gdbus_call_call_leave_multiparty_finish (MM_GDBUS_CALL (self), res, error); +} + +/** + * mm_call_leave_multiparty: + * @self: A #MMCall. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Synchronously requests to make this call private again by leaving the + * multiparty call. + * + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call mm_call_leave_multiparty_finish() to get the result of the operation. + * + * See mm_call_leave_multiparty_sync() for the synchronous, blocking version of this method. + */ +void +mm_call_leave_multiparty (MMCall *self, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_return_if_fail (MM_IS_CALL (self)); + + mm_gdbus_call_call_leave_multiparty (MM_GDBUS_CALL (self), + cancellable, + callback, + user_data); +} + +/** + * mm_call_leave_multiparty_sync: + * @self: A #MMCall. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously requests to make this call private again by leaving the + * multiparty call. + * + * The calling thread is blocked until an incoming call is ready. + * See mm_call_leave_multiparty() for the asynchronous version of this method. + * + * Returns: %TRUE if the operation succeeded, %FALSE if @error is set. + */ +gboolean +mm_call_leave_multiparty_sync (MMCall *self, + GCancellable *cancellable, + GError **error) +{ + g_return_val_if_fail (MM_IS_CALL (self), FALSE); + + return mm_gdbus_call_call_leave_multiparty_sync (MM_GDBUS_CALL (self), + cancellable, + error); +} + /*****************************************************************************/ /** diff --git a/libmm-glib/mm-call.h b/libmm-glib/mm-call.h index d073120f..3ae5a775 100644 --- a/libmm-glib/mm-call.h +++ b/libmm-glib/mm-call.h @@ -127,6 +127,31 @@ gboolean mm_call_deflect_sync (MMCall *self, GCancellable *cancellable, GError **error); +void mm_call_join_multiparty (MMCall *self, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean mm_call_join_multiparty_finish (MMCall *self, + GAsyncResult *res, + GError **error); + +gboolean mm_call_join_multiparty_sync (MMCall *self, + GCancellable *cancellable, + GError **error); + +void mm_call_leave_multiparty (MMCall *self, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean mm_call_leave_multiparty_finish (MMCall *self, + GAsyncResult *res, + GError **error); + +gboolean mm_call_leave_multiparty_sync (MMCall *self, + GCancellable *cancellable, + GError **error); void mm_call_hangup (MMCall *self, GCancellable *cancellable, |