summaryrefslogtreecommitdiff
path: root/src/mcd-account-compat.c
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2009-04-02 20:09:52 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2009-04-02 20:37:02 +0100
commit5815963fa4d5d8f4c1767302cc6fdb81c4d7383a (patch)
treefc4218791c540f18ffa3a27e1fad8fa688ce375b /src/mcd-account-compat.c
parent91845ead0fdfa71c650497a9455a70c4d265d485 (diff)
McdAccount: Compat: remove old channel-requesting API (no longer used)
Diffstat (limited to 'src/mcd-account-compat.c')
-rw-r--r--src/mcd-account-compat.c121
1 files changed, 0 insertions, 121 deletions
diff --git a/src/mcd-account-compat.c b/src/mcd-account-compat.c
index dba47339..7f3cb706 100644
--- a/src/mcd-account-compat.c
+++ b/src/mcd-account-compat.c
@@ -202,127 +202,6 @@ account_compat_iface_init (McSvcAccountInterfaceCompatClass *iface,
#undef IMPLEMENT
}
-static void
-process_channel_request (McdAccount *account, gpointer userdata,
- const GError *error)
-{
- McdChannel *channel = MCD_CHANNEL (userdata);
- McdConnection *connection;
-
- if (error)
- {
- g_warning ("%s: got error: %s", G_STRFUNC, error->message);
- /* TODO: report the error to the requestor process */
- g_object_unref (channel);
- return;
- }
- DEBUG ("called");
- connection = mcd_account_get_connection (account);
- g_return_if_fail (connection != NULL);
- g_return_if_fail (mcd_connection_get_connection_status (connection)
- == TP_CONNECTION_STATUS_CONNECTED);
-
- mcd_connection_request_channel (connection, channel);
-}
-
-static void
-on_channel_status_changed (McdChannel *channel, McdChannelStatus status,
- McdAccount *account)
-{
- McdAccountCompatReq *req_data;
-
- DEBUG ("%u", status);
- g_return_if_fail (MCD_IS_ACCOUNT (account));
-
- if (status == MCD_CHANNEL_STATUS_FAILED &&
- (req_data = g_object_get_data ((GObject *)channel, COMPAT_REQ_DATA))
- != NULL)
- {
- const GError *error;
- McdMaster *master;
-
- master = mcd_master_get_default ();
- g_return_if_fail (MCD_IS_SERVICE (master));
-
- error = mcd_channel_get_error (channel);
- g_signal_emit_by_name (master, "mcd-error",
- req_data->requestor_serial,
- req_data->requestor_client_id, error->code);
- }
- else if (status == MCD_CHANNEL_STATUS_DISPATCHED)
- {
- /* we don't need the request data anymore */
- g_object_set_data ((GObject *)channel, COMPAT_REQ_DATA, NULL);
- }
-}
-
-static void
-compat_req_data_free (McdAccountCompatReq *req)
-{
- g_free (req->requestor_client_id);
- g_slice_free (McdAccountCompatReq, req);
-}
-
-gboolean
-_mcd_account_compat_request_channel_nmc4 (McdAccount *account,
- const struct mcd_channel_request *req,
- GError **error)
-{
- McdChannel *channel;
- McdAccountCompatReq *req_data;
- GHashTable *properties;
- GValue *value;
- McdDispatcher *dispatcher;
-
- properties = g_hash_table_new_full (g_str_hash, g_str_equal,
- NULL,
- (GDestroyNotify)tp_g_value_slice_free);
-
- value = tp_g_value_slice_new (G_TYPE_STRING);
- g_value_set_string (value, req->channel_type);
- g_hash_table_insert (properties, TP_IFACE_CHANNEL ".ChannelType", value);
-
- if (req->channel_handle_string)
- {
- value = tp_g_value_slice_new (G_TYPE_STRING);
- g_value_set_string (value, req->channel_handle_string);
- g_hash_table_insert (properties, TP_IFACE_CHANNEL ".TargetID", value);
- }
-
- if (req->channel_handle)
- {
- value = tp_g_value_slice_new (G_TYPE_UINT);
- g_value_set_uint (value, req->channel_handle);
- g_hash_table_insert (properties, TP_IFACE_CHANNEL ".TargetHandle",
- value);
- }
-
- value = tp_g_value_slice_new (G_TYPE_UINT);
- g_value_set_uint (value, req->channel_handle_type);
- g_hash_table_insert (properties, TP_IFACE_CHANNEL ".TargetHandleType",
- value);
-
- channel = mcd_channel_new_request (properties, 0, NULL);
- g_hash_table_unref (properties);
-
- dispatcher = mcd_master_get_dispatcher (mcd_master_get_default ());
- _mcd_dispatcher_add_request (dispatcher, account, channel);
-
- req_data = g_slice_new0 (McdAccountCompatReq);
- req_data->requestor_serial = req->requestor_serial;
- req_data->requestor_client_id = g_strdup (req->requestor_client_id);
- g_object_set_data_full ((GObject *)channel, COMPAT_REQ_DATA,
- req_data, (GDestroyNotify)compat_req_data_free);
-
- g_signal_connect (channel, "status-changed",
- G_CALLBACK (on_channel_status_changed), account);
-
- return _mcd_account_online_request (account,
- process_channel_request,
- channel,
- error);
-}
-
/**
* mcd_account_compat_get_profile:
* @account: the #McdAccount.