[Bug 30874] GetContactAttributesByID: GetContactAttributes but from identifiers instead of handles

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed May 9 10:16:03 CEST 2012


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

--- Comment #9 from Xavier Claessens <xclaesse at gmail.com> 2012-05-09 01:16:03 PDT ---
(In reply to comment #7)
> Since you've only added GetContactByID just now, I'd like a fallback path via
> RequestHandles and GetContactAttributes if it raises NotImplemented (or
> anything other than InvalidHandle, really), so that it can be guaranteed to
> work on any Contacts CM[1].

I think this is useless, since all CM in the real world uses tp-glib now, and
app wanting to work with hypotetical CM can just use deprecated symbols. Also
the upgrade path has always been broken and will be even more with migration to
1.0. We don't like windows asking a reboot after update, be let's be serious,
it's needed...

But anyway, did it.

> + * @contacts: (element-type TelepathyGLib.Contact) (transfer container) (out)
> (allow-none):
> + * a location to set a #GPtrArray of upgraded #TpContact, or %NULL.
> 
> I'd prefer it if this returned the GPtrArray in the usual way, rather than
> outputting it through an out parameter.

I do as an out param to make it optional. The user is supposed to already know
its contacts, so it is common it won't need it. If I set it as return then user
will have to unref it.

> + die_if (error, "tp_connection_get_contact_by_id_async()");
> 
> This leaks... I think the solution is to not use die_if there.

It is actually wrong usage of die_if(), that function does not make the process
exit as I was expecting but just quit the main loop. So the caller still have
to make the return.

> +_TP_DEPRECATED_IN_UNRELEASED
> void tp_connection_get_contacts_by_handle (TpConnection *self,
> 
> I'm not sure that deprecating this immediately necessarily makes sense. If a
> client has obtained a handle from an extended (domain-specific) interface
> (perhaps a rubbish one, like Renaming), what's it meant to do with it? The
> answer in this branch seems to be "do GetContactAttributes yourself", and I
> don't think that's the answer we want.

That's the whole point in deprecating stuff: users are notified that they need
to change their code, fix rubish ifaces, etc. Just like I've discovered that
Connection::self-handle and StreamTube::NewRemoteConnection does not give the
id, so that code uses G_GNUC_BEGIN_IGNORE_DEPRECATIONS for now.



All the rest is now fixed in the branch

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- 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