diff options
author | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2010-02-25 23:24:52 +0800 |
---|---|---|
committer | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2010-02-25 23:40:42 +0800 |
commit | 8e24107b437f63d9b2ca93e0d5b7379ee87af98d (patch) | |
tree | cad02fd6547ec8c7c28f41b7eeb7b82f43edb8cc | |
parent | 0e74039b5cadb3e33aa01f5c2f3650b9d39f16ae (diff) | |
download | gsoc2013-empathy-8e24107b437f63d9b2ca93e0d5b7379ee87af98d.tar gsoc2013-empathy-8e24107b437f63d9b2ca93e0d5b7379ee87af98d.tar.gz gsoc2013-empathy-8e24107b437f63d9b2ca93e0d5b7379ee87af98d.tar.bz2 gsoc2013-empathy-8e24107b437f63d9b2ca93e0d5b7379ee87af98d.tar.lz gsoc2013-empathy-8e24107b437f63d9b2ca93e0d5b7379ee87af98d.tar.xz gsoc2013-empathy-8e24107b437f63d9b2ca93e0d5b7379ee87af98d.tar.zst gsoc2013-empathy-8e24107b437f63d9b2ca93e0d5b7379ee87af98d.zip |
Cope with tp-glib calling the callback in sync
-rw-r--r-- | libempathy/empathy-dispatcher.c | 45 |
1 files changed, 29 insertions, 16 deletions
diff --git a/libempathy/empathy-dispatcher.c b/libempathy/empathy-dispatcher.c index f589099d6..caf697cb6 100644 --- a/libempathy/empathy-dispatcher.c +++ b/libempathy/empathy-dispatcher.c @@ -1392,13 +1392,16 @@ dispatcher_request_channel (DispatcherRequestData *request_data) } else { - request_data->pending_call = tp_cli_connection_call_request_channel ( + TpProxyPendingCall *call = tp_cli_connection_call_request_channel ( request_data->connection, -1, request_data->channel_type, request_data->handle_type, request_data->handle, TRUE, dispatcher_request_channel_cb, request_data, NULL, NULL); + + if (call != NULL) + request_data->pending_call = call; } } @@ -1535,6 +1538,7 @@ empathy_dispatcher_join_muc (TpConnection *connection, DispatcherRequestData *request_data; ConnectionData *connection_data; const gchar *names[] = { roomname, NULL }; + TpProxyPendingCall *call; g_return_if_fail (TP_IS_CONNECTION (connection)); g_return_if_fail (!EMP_STR_EMPTY (roomname)); @@ -1554,11 +1558,14 @@ empathy_dispatcher_join_muc (TpConnection *connection, connection_data->outstanding_requests = g_list_prepend (connection_data->outstanding_requests, request_data); - request_data->pending_call = tp_cli_connection_call_request_handles ( + call = tp_cli_connection_call_request_handles ( connection, -1, TP_HANDLE_TYPE_ROOM, names, dispatcher_request_handles_cb, request_data, NULL, NULL); + if (call != NULL) + request_data->pending_call = call; + g_object_unref (self); } @@ -1644,6 +1651,7 @@ dispatcher_create_channel_cb (TpChannelDispatcher *proxy, EmpathyDispatcherPriv *priv = GET_PRIV (dispatcher); TpChannelRequest *request; GError *err = NULL; + TpProxyPendingCall *call; request_data->pending_call = NULL; @@ -1674,9 +1682,12 @@ dispatcher_create_channel_cb (TpChannelDispatcher *proxy, return; } - request_data->pending_call = tp_cli_channel_request_call_proceed (request, + call = tp_cli_channel_request_call_proceed (request, -1, dispatcher_channel_request_proceed_cb, request_data, NULL, G_OBJECT (self)); + + if (call != NULL) + request_data->pending_call = call; } static void @@ -1687,6 +1698,7 @@ empathy_dispatcher_call_create_or_ensure_channel ( EmpathyDispatcherPriv *priv = GET_PRIV (dispatcher); TpAccount *account; const gchar *handler = ""; + TpProxyPendingCall *call; account = empathy_get_account_for_connection (request_data->connection); @@ -1697,23 +1709,24 @@ empathy_dispatcher_call_create_or_ensure_channel ( if (request_data->should_ensure) { - request_data->pending_call = - tp_cli_channel_dispatcher_call_ensure_channel ( - priv->channel_dispatcher, - -1, tp_proxy_get_object_path (TP_PROXY (account)), - request_data->request, 0, handler, - dispatcher_create_channel_cb, request_data, NULL, NULL); + call = tp_cli_channel_dispatcher_call_ensure_channel ( + priv->channel_dispatcher, + -1, tp_proxy_get_object_path (TP_PROXY (account)), + request_data->request, 0, handler, + dispatcher_create_channel_cb, request_data, NULL, NULL); } else { - request_data->pending_call = - tp_cli_channel_dispatcher_call_create_channel ( - priv->channel_dispatcher, - -1, tp_proxy_get_object_path (TP_PROXY (account)), - request_data->request, 0, handler, - dispatcher_create_channel_cb, request_data, NULL, - G_OBJECT (dispatcher)); + call = tp_cli_channel_dispatcher_call_create_channel ( + priv->channel_dispatcher, + -1, tp_proxy_get_object_path (TP_PROXY (account)), + request_data->request, 0, handler, + dispatcher_create_channel_cb, request_data, NULL, + G_OBJECT (dispatcher)); } + + if (call != NULL) + request_data->pending_call = call; } /** |