Bug 55883 - ClientTypes list is not updated when contact goes offline
Summary: ClientTypes list is not updated when contact goes offline
Status: NEW
Alias: None
Product: Telepathy
Classification: Unclassified
Component: gabble (show other bugs)
Version: git master
Hardware: Other All
: medium normal
Assignee: Telepathy bugs list
QA Contact: Telepathy bugs list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-11 18:39 UTC by Dan Vrátil
Modified: 2012-10-12 10:47 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Proposed patch (588 bytes, text/plain)
2012-10-11 18:39 UTC, Dan Vrátil
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Vrátil 2012-10-11 18:39:03 UTC
Created attachment 68452 [details]
Proposed patch

When a contact goes offline it's clientTypes list is not updated (cleared) so it still contains "pc" or "mobile", but that's not true anymore.

I don't know where exactly this should be fixed - whether backend should send a signal with empty clientTypes list when contact goes offline, or whether TelepathyQt should handle this on it's own. As I'm not much familiar with the code, the attached patch simply clears Tp::Contact::Private::mClientTypes list when contact's presence changes to offline.
Comment 1 Simon McVittie 2012-10-12 10:06:33 UTC
(In reply to comment #0)
> When a contact goes offline it's clientTypes list is not updated (cleared)
> so it still contains "pc" or "mobile", but that's not true anymore.

I think this is a connection manager ("backend") bug: ClientTypesUpdated(handle, []) should be emitted. Client code shouldn't have to understand the relationship between client types and presence.

telepathy-gabble seems to be our only major CM with ClientTypes support, so I'm reassigning this bug there. Please clone this bug if you have seen this in other CMs.
Comment 2 Simon McVittie 2012-10-12 10:47:11 UTC
Here is a regression test for Gabble if anyone wants to work on this. I had a quick look, but the presence/presence-cache code is a bit tangled.

diff --git a/tests/twisted/client-types.py b/tests/twisted/client-types.py
index 2eaeebe..62ea62e 100644
--- a/tests/twisted/client-types.py
+++ b/tests/twisted/client-types.py
@@ -241,6 +241,13 @@ def test2(q, bus, conn, stream):
     assertContains(attr, attrs[handle])
     assertEquals(['pc'], attrs[handle][attr])
 
+    # both devices go offline
+    stream.send(make_presence(marco_pidgin, type='unavailable'))
+    q.expect('dbus-signal', signal='ClientTypesUpdated',
+             args=[handle, ['phone']])
+    stream.send(make_presence(marco_phone, type='unavailable'))
+    q.expect('dbus-signal', signal='ClientTypesUpdated', args=[handle, []])
+
 def two_contacts_with_the_same_hash(q, bus, conn, stream, bare_jids):
     contact1 = 'bowyer.place@tfl.gov.uk'
     contact2 = 'albany.road@tfl.gov.uk'


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.