After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 737721 - Allow account ID to be provided for new accounts
Allow account ID to be provided for new accounts
Status: RESOLVED FIXED
Product: gnome-online-accounts
Classification: Core
Component: general
3.14.x
Other Linux
: Normal enhancement
: ---
Assigned To: GNOME Online Accounts maintainer(s)
GNOME Online Accounts maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-10-01 14:04 UTC by Matthew Barnes
Modified: 2014-10-08 17:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Untested patch (1.71 KB, patch)
2014-10-01 14:14 UTC, Matthew Barnes
accepted-commit_now Details | Review
daemon: Allow account ID to be provided for new accounts (1.43 KB, patch)
2014-10-08 16:37 UTC, Debarshi Ray
committed Details | Review

Description Matthew Barnes 2014-10-01 14:04:45 UTC
Fleet Commander's GOA integration will need to use the AddAccount method to deploy accounts configured by an administrator.

Along with the new IsLocked property described in bug 737656, I'd also like to supply my own account Id by way of the 'details' dictionary parameter.  This would make it easier to keep deployed accounts synchronized with profile data published on the server side.
Comment 1 Matthew Barnes 2014-10-01 14:14:53 UTC
Created attachment 287518 [details] [review]
Untested patch

Not quite far enough on the Fleet Commander side to test this yet, but I think it should work.

As noted in the patch, it could be a tad cleaner once GOA requires GLib 2.40 and can use g_variant_dict_remove().  Not sure this is worth bumping the requirement over though.
Comment 2 Matthew Barnes 2014-10-06 12:47:41 UTC
(In reply to comment #1)
> As noted in the patch, it could be a tad cleaner once GOA requires GLib 2.40
> and can use g_variant_dict_remove().  Not sure this is worth bumping the
> requirement over though.

Having learned a bit more about GVariantDict, I don't think it will work well for this case after all.  GVariantDict operates on "a{sv}" dictionaries, whereas the details dictionary is "a{ss}".

Best discard my "XXX" comment in the patch before committing.
Comment 3 Debarshi Ray 2014-10-08 16:36:42 UTC
Review of attachment 287518 [details] [review]:

Looks good. Thanks for the patch.

::: src/daemon/goadaemon.c
@@ +828,3 @@
+    {
+      /* XXX Use g_variant_dict_remove() here once we require GLib 2.40.
+       *     Then we can remove the check for Id in the loop below. */

Yeah, as you said, g_variant_dict_remove won't be appropriate here.
Comment 4 Debarshi Ray 2014-10-08 16:37:57 UTC
Created attachment 288056 [details] [review]
daemon: Allow account ID to be provided for new accounts

I added the bug number to the commit message, and removed the comment about g_variant_dict_remove.
Comment 5 Matthew Barnes 2014-10-08 17:03:30 UTC
Thanks!