Bug 25181

Summary: tp_connection_get_contacts_by_handle always calls GetContactAttributes
Product: Telepathy Reporter: Guillaume Desmottes <guillaume.desmottes>
Component: tp-glibAssignee: Telepathy bugs list <telepathy-bugs>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: major    
Priority: medium Keywords: patch
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Guillaume Desmottes 2009-11-19 03:40:53 UTC
Original Empathy bug report: https://bugzilla.gnome.org/show_bug.cgi?id=602328

To reproduce:
- start a chat with a contact using Empathy and launch dbus-monitor
- start typing in the chat window: GetContactAttributes () is called
- wait a bit that Empathy's typing timer times out: GetContactAttributes () is called again
- start typing again: GetContactAttributes () is called
- etc.

That's because each time the ChatStateChanged signal is fired, Empathy calls tp_connection_get_contacts_by_handle() to get the TpContact object associated with the signal. As Empathy already keep a ref on this TpContact, tp-glib is supposed to return the existing contact object (which it does, pointers are the same) but it still makes a call to GetContactAttributes ().
It shouldn't call this function when re-using an existing contact object as this leads to useless D-Bus round trips.

Note that if you are using a released Empathy version, you'll see 2 calls of GetContactAttributes(). That's because Empathy was handling the ChatStateChanged twice. This has been fixed in master and gnome-2.28.
Comment 1 David Laban 2009-11-20 14:19:41 UTC
That really shouldn't have taken me so long. Done now though.

http://git.collabora.co.uk/?p=user/alsuren/telepathy-glib.git;a=shortlog;h=refs/heads/fix-25181
Comment 2 David Laban 2009-11-23 03:41:47 UTC
fix merged

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.