~chipaca/ubuntu-push/gsettings

« back to all changes in this revision

Viewing changes to accounts/caccounts.go

  • Committer: Tarmac
  • Author(s): John R. Lenton
  • Date: 2014-09-05 19:12:38 UTC
  • mfrom: (325.1.3 libaccounts)
  • Revision ID: tarmac-20140905191238-7xy6j2tif4hqnsya
[r=ralsina] Use libaccounts to track changes to the u1 account used for auth; restart the session on change.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package accounts
 
2
 
 
3
/*
 
4
#include <libaccounts-glib/accounts-glib.h>
 
5
 
 
6
static void cb(AgManager *manager, AgAccountId account_id, gpointer p) {
 
7
    AgAccount *account = ag_manager_get_account(manager, account_id);
 
8
    if (!account) {
 
9
        return;
 
10
    }
 
11
    GList *services = ag_account_list_services(account);
 
12
    if (!services || !services->data) {
 
13
        return;
 
14
    }
 
15
 
 
16
    gocb();
 
17
}
 
18
 
 
19
void start() {
 
20
    AgManager *manager = ag_manager_new_for_service_type("ubuntuone");
 
21
    g_signal_connect(manager, "account-created", G_CALLBACK(cb), NULL);
 
22
    g_signal_connect(manager, "account-deleted", G_CALLBACK(cb), NULL);
 
23
    g_signal_connect(manager, "account-updated", G_CALLBACK(cb), NULL);
 
24
 
 
25
}
 
26
 
 
27
*/
 
28
import "C"