Bug 27671

Summary: ContactInfo high-level API
Product: Telepathy Reporter: Simon McVittie <smcv>
Component: tp-qtAssignee: Telepathy bugs list <telepathy-bugs>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: enhancement    
Priority: medium Keywords: patch
Version: git master   
Hardware: Other   
OS: All   
URL: http://git.collabora.co.uk/?p=user/andrunko/telepathy-qt4.git;a=shortlog;h=refs/heads/contact-info
Whiteboard:
i915 platform: i915 features:
Bug Depends on: 27670    
Bug Blocks:    

Description Simon McVittie 2010-04-15 13:59:35 UTC
+++ This bug was initially created as a clone of Bug #27670 +++

Summary says it all. I'm not sure what API you'd want for it...
Comment 1 Simon McVittie 2010-04-15 14:39:38 UTC
Bug #27676 is the GLib equivalent.
Comment 2 Simon McVittie 2010-04-30 08:51:31 UTC
16:47 < wjt> andrunko: hey, i just spoke to barisione irl
16:47 < wjt> andrunko: he thinks what he'd like is:
16:48 < wjt> • a feature which calls GetContactInfo (or uses the corresponding 
             contact attribute, if one is added), and listens for change 
             notification
16:48 < wjt> • a method to explicitly request the latest info
16:49 < wjt> the point being that then the application can safely turn on the 
             ContactInfo feature and get vCards opportunistically on XMPP, 
             without risking causing lots of network traffic
16:49 < wjt> and then once every few months, they can refresh
...
16:50 < smcv> for the method to explicitly request the latest info, presumably 
              we want both PendingContactInfo 
              *Tp::Contact::requestContactInfo(), and void 
              Tp::Connection::refreshContactInfo(SET<Tp::Contact>) for some 
              suitable type SET?
Comment 3 Andre Moreira Magalhaes 2010-04-30 14:08:57 UTC
Description of changes:
- Added FeatureInfo to Tp::Contact that will use the contact-attribute ContactInfo/info to retrieve the cached info and connect to ContactInfoChanged.
- Added Tp::Contact::refreshInfo to force information refresh (depends on FeatureInfo to be enabled cause the update is signalled using ContactInfoChanged which is only handled when FeatureInfo is enabled).
- Added Tp::Contact::requestInfo to request a info without using FeatureInfo. There is no change notification if FeatureInfo is not enabled)
- Patched contacts-conn example cm to support the ContactInfo iface (will file a bug against tp-glib to merge it once this is approved)
- Used the modified version of contacts-conn to write the tests

Note that I used info to represent ContactInfo as it's already inside Contact, so Contact::contactInfo is redundant. The same is used for ContactCapabilities where we just use capabilities for the names.

Info is too generic, maybe we want to change it to VCard or something like this.
Comment 4 Ian Monroe 2010-05-04 13:17:34 UTC
Reviewed, looks good.
Comment 5 Andre Moreira Magalhaes 2010-05-06 01:37:40 UTC
Merged upstream. It will be in next relase (0.3.3)

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.