Bug 28902 - Implement Account.Service property
Summary: Implement Account.Service property
Status: RESOLVED FIXED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: mission-control (show other bugs)
Version: git master
Hardware: Other All
: medium normal
Assignee: Telepathy bugs list
QA Contact: Telepathy bugs list
URL: http://git.collabora.co.uk/?p=user/vi...
Whiteboard: r-, minorer
Keywords: patch
Depends on:
Blocks:
 
Reported: 2010-07-04 04:25 UTC by Will Thompson
Modified: 2010-10-07 08:24 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Will Thompson 2010-07-04 04:25:08 UTC
Telepathy spec version 0.9.18 introduced <http://telepathy.freedesktop.org/spec/Account.html#org.freedesktop.Telepathy.Account.Service>. MC should implement it!

(It should also implement http://telepathy.freedesktop.org/spec/Account_Interface_Storage.html#Storage_Restriction_Flags Cannot_Set_Service but that's blocked by bug 28192.)
Comment 1 Will Thompson 2010-07-04 04:25:47 UTC
Here is Vivek's branch implementing the property.
Comment 2 Will Thompson 2010-07-04 04:26:33 UTC
I have a branch at http://git.collabora.co.uk/?p=user/wjt/telepathy-mission-control-wjt.git;a=shortlog;h=refs/heads/sso-updates%2Bservice-property which updates mc-tool to support setting the Service property, just as it supports setting Icon and friends.
Comment 3 Will Thompson 2010-07-04 04:30:52 UTC
The spec doesn't say that Account.Service should fall back to the protocol; it says that if it's the empty string, the service is determined by the protocol name. I'm inclined to think that MC should report service-less accounts with Account.Service = "".

The test doesn't test specifying Service at account creation time.

The patch named 'ibid' should be squashed into the preceding patch (which it fixes).

+    assert account_props.Get(cs.ACCOUNT, 'Service') == 'fu-bar'

assertEquals

+    # OK, let's go online

but that's not what happens next in the test.

There are a load of unused imports in the test.

(I have not reviewed the branch on which this branch is stacked.)
Comment 4 Will Thompson 2010-07-05 10:03:02 UTC
+        g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
+                     "Service cannot be set to '%s' (%s)",
+                     g_value_get_string (value),
+                     G_VALUE_TYPE_NAME (value));

What's the point of including the type name? we know it's a string (don't we? doesn't MC's property fu ensure that? if it doesn't we'll already have critical'd from the g_value_get_string()s). And this error would be more useful if it said something like "'%s' is an invalid service name; service names consist only of ASCII letters, numbers and hyphen/minus signs, and start with a letter".

+    /* fall back to the protocol if nothing is explicitly set, as per spec */
+    if (g_value_get_string (value) == NULL)
+        g_value_set_string (value, "");

Comment no match code.
Comment 5 Simon McVittie 2010-10-07 08:24:58 UTC
This appears to have been released in 5.5.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.