[Bug 75204] [next] remove TpAsv from public API

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Feb 24 04:03:26 PST 2014


https://bugs.freedesktop.org/show_bug.cgi?id=75204

--- Comment #10 from Simon McVittie <simon.mcvittie at collabora.co.uk> ---
Empathy, first commit:

+ g_variant_dict_init (&dict, NULL);
+ g_variant_dict_insert (&dict, TP_PROP_CHANNEL_CHANNEL_TYPE, "s",
+ TP_IFACE_CHANNEL_TYPE_TEXT);
+ g_variant_dict_insert (&dict, TP_PROP_CHANNEL_TARGET_ENTITY_TYPE, "u",
+ TP_ENTITY_TYPE_CONTACT);
+ g_variant_dict_insert (&dict, TP_PROP_CHANNEL_TARGET_ID, "s", contact_id);
- req = tp_account_channel_request_new (priv->account, request,
- empathy_get_current_action_time ());
+ req = tp_account_channel_request_new (priv->account,
+ g_variant_dict_end (&dict), empathy_get_current_action_time ());

High-level API, please:

    req = tp_account_channel_request_new_text (priv->account,
        empathy_get_current_action_time ());
    tp_account_channel_request_set_target_id (priv->account,
        TP_ENTITY_TYPE_CONTACT, contact_id);

I'd prefer to use tp_account_channel_request_new_audio_[video_]call() in
empathy_call_create_call_request(), too, but that function currently copes with
being called with initial_audio=False and we don't have high-level API for
that. (Does Empathy ever actually do that?)

> empathy_share_my_desktop_share_with_contact

I thought we had high-level API for this too, but apparently not. Maybe we
should. However, you could at least replace these:

+ g_variant_dict_insert (&request, TP_PROP_CHANNEL_TARGET_ENTITY_TYPE, "u",
+ TP_ENTITY_TYPE_CONTACT);
+ g_variant_dict_insert (&request, TP_PROP_CHANNEL_TARGET_HANDLE, "u",
+ tp_contact_get_handle (tp_contact));

with a call to tp_account_channel_request_set_target_contact() after the
request has been created?

+ priv->request = g_variant_dict_new (NULL);
+ g_variant_dict_insert (priv->request, TP_PROP_CHANNEL_CHANNEL_TYPE,
+ "s", TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER1);
+ g_variant_dict_insert (priv->request, TP_PROP_CHANNEL_TARGET_ENTITY_TYPE,
+ "u", TP_ENTITY_TYPE_CONTACT);
+ g_variant_dict_insert (priv->request, TP_PROP_CHANNEL_TARGET_HANDLE,
+ "u", contact_handle);
+ g_variant_dict_insert (priv->request,
+ TP_PROP_CHANNEL_TYPE_FILE_TRANSFER1_CONTENT_TYPE,
+ "s", priv->content_type);
+ g_variant_dict_insert (priv->request,
+ TP_PROP_CHANNEL_TYPE_FILE_TRANSFER1_FILENAME, "s", priv->filename);
+ g_variant_dict_insert (priv->request,
+ TP_PROP_CHANNEL_TYPE_FILE_TRANSFER1_SIZE, "t", priv->total_bytes);
+ g_variant_dict_insert (priv->request,
+ TP_PROP_CHANNEL_TYPE_FILE_TRANSFER1_DATE, "t", priv->mtime);
+ g_variant_dict_insert (priv->request,
TP_PROP_CHANNEL_TYPE_FILE_TRANSFER1_URI,
+ "s", uri);

tp_account_channel_request_new_file_transfer() +
tp_account_channel_request_set_target_contact() +
tp_account_channel_request_set_file_transfer_timestamp() +
tp_account_channel_request_set_file_transfer_uri() covers all of this.

The hash stuff doesn't have high-level API but could use
tp_account_channel_request_set_request_property().

create_text_channel(): similar, please.

empathy_tp_chat_add(): the same.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the telepathy-bugs mailing list