Bug 37359 - TpChannel: high level API to invite a contact
Summary: TpChannel: high level API to invite a contact
Status: RESOLVED MOVED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: tp-glib (show other bugs)
Version: unspecified
Hardware: Other All
: medium enhancement
Assignee: Telepathy bugs list
QA Contact: Telepathy bugs list
URL: http://cgit.collabora.com/git/user/xc...
Whiteboard: EmpathyTpChat
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-19 04:50 UTC by Guillaume Desmottes
Modified: 2019-12-03 20:38 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Guillaume Desmottes 2011-05-19 04:50:05 UTC
Probably something like:

void tp_channel_invite_contact_async (TpChannel *self,
    TpContact *contact,
    const gchar *message,
    GAsyncReadyCallback callback,
    gpointer user_data);
Comment 1 Guillaume Desmottes 2011-05-19 04:51:35 UTC
Would be good to have an equivalent for RemoveMembers() as well.
Comment 2 Guillaume Desmottes 2011-05-19 04:54:59 UTC
We could have _join_async() well adding ourself (to accept an invitation for example).
Comment 3 Xavier Claessens 2011-06-27 03:58:08 UTC
Note that my contact-list branch adds _async() wrappers for Group iface methods:
http://cgit.collabora.com/git/user/xclaesse/telepathy-glib.git/log/?h=contact-list

Invite a contact just just a AddMembers, right?

tp_channel(_group?)_invite_contact_async() would just be a 1 contact helper around tp_channel_group_add_members_async(), which could indeed be nice.

tp_channel(_group?)_join_async() would be an even nicer helper around tp_channel_group_add_members_async() that adds the channel's self handle.
Comment 4 Xavier Claessens 2011-07-13 06:57:01 UTC
(In reply to comment #2)
> We could have _join_async() well adding ourself (to accept an invitation for
> example).

That part is already fixed with tp_channel_join_async()
Comment 5 Xavier Claessens 2011-07-13 07:16:57 UTC
EmpathyTpChat has an interesting API to call AddMembers in the case the channel has GROUP iface, and fallback to request a new channel with conference interface to upgrade the channel.

I'm suggesting this API:

void tp_channel_invite_contacts_async (TpChannel *self,
    guint n_contacts,
    TpContact * const *contacts,
    const gchar *message,
    gboolean handle_channel,
    GAsyncReadyCallback callback,
    gpointer user_data);

gboolean tp_channel_invite_contacts_finish (TpChannel *self,
    GAsyncResult *result,
    TpChannel **new_channel,
    GError **error);

In the case self has GROUP iface, it will just do a AddMembers. handle_channel boolean is ignored and new_channel out arg is set to NULL (or set to self?)

In the case self does not have GROUP iface, it will do tp_account_channel_request_create_and_observe/handle_channel_async (depending on the handle_channel flag) and the new_channel out arg will be set to the new TpChannel that has conference with contacts invited.


I think this API would be convenient, but does not look so nice because we have 2 asymetric cases. Also TpChannel does not know its TpAccount to create its TpAccountChannelRequest...

Opinions, ideas?
Comment 6 Xavier Claessens 2011-07-15 06:00:51 UTC
For the record, here is a branch with _invite_contacts and _remove_contacts to wrap AddMembers and RemoveMembers.
Comment 7 Simon McVittie 2013-06-10 14:11:47 UTC
The patch appears to have vanished from cgit. Is this still wanted?
Comment 8 GitLab Migration User 2019-12-03 20:38:17 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/telepathy/telepathy-glib/issues/65.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.