Bug 55883

Summary: ClientTypes list is not updated when contact goes offline
Product: Telepathy Reporter: Dan Vrátil <dvratil>
Component: gabbleAssignee: Telepathy bugs list <telepathy-bugs>
Status: RESOLVED MOVED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium    
Version: git master   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Proposed patch

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'
Comment 3 GitLab Migration User 2019-12-03 19:57:58 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/telepathy/telepathy-gabble/issues/243.

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.