Bug 37748 - Tp::ContactManager::lookupContactByHandle is public
Summary: Tp::ContactManager::lookupContactByHandle is public
Status: RESOLVED FIXED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: tp-qt (show other bugs)
Version: git master
Hardware: All All
: medium normal
Assignee: Telepathy bugs list
QA Contact: Telepathy bugs list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-30 07:41 UTC by Olli Salli
Modified: 2011-12-20 07:18 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Olli Salli 2011-05-30 07:41:08 UTC
Since 2009:

commit 2fd8c3cfdb1bc9cca2221ae7575e06c12038f3db
Author: Andre Moreira Magalhaes (andrunko) <andre.magalhaes@collabora.co.uk>
Date:   Wed Mar 11 02:43:40 2009 -0300

    ContactManager: Export lookupContactByHandle.

:o

This steers people to try and use it to get contact objects instead of correctly building them asynchronously using contactsFor{Identifiers,Handles}. There's even incorrect internal usage like that!

        // let's try to get the actor contact from contact manager if available
        groupSelfContactRemoveInfo = GroupMemberChangeDetails(
                connection->contactManager()->lookupContactByHandle(
                    qdbus_cast<uint>(details.value(QLatin1String("actor")))),
                details);

We'll have to deprecate it and then fix anybody who was (incorrectly) using it.
Comment 1 Simon McVittie 2011-05-30 07:48:27 UTC
I think that internal usage is appropriate, actually: it'd be overkill to report removal of a contact who nobody knew about in the first place, so you probably only want to provide the Tp::Contact if they were already in the group? And if they're in the group, I'd hope the group would cache a Tp::Contact.

(If you have an equivalent of tp_connection_dup_contact_if_possible() you should use that instead, though.)
Comment 2 Olli Salli 2011-05-30 07:51:31 UTC
That's the actor in the remove info, not the person who was removed (though of course on most/all protocols, it'll be either the same contact (us) or somebody else in the room). Nothing in the spec disallows an outside actor for a removal though (a network admin?).
Comment 3 Andre Moreira Magalhaes 2011-12-20 07:18:11 UTC
Fix merged upstream, it will be in tp-qt 0.9.0


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.