~alecu/ubuntuone-client/assertis-is-only-27

« back to all changes in this revision

Viewing changes to libsyncdaemon/syncdaemon-authentication.c

  • Committer: Tarmac
  • Author(s): Alejandro J. Cura
  • Date: 2011-04-19 15:09:36 UTC
  • mfrom: (958.3.1 the-other-signal)
  • Revision ID: tarmac-20110419150936-6vkvd144u0wdmmjh
Listen to the same DBus interface that Syncdaemon uses (LP: #759197)

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
struct _SyncdaemonAuthenticationPrivate {
32
32
        DBusGConnection *bus;
33
33
        DBusGProxy *proxy;
 
34
        DBusGProxy *newer_proxy;
34
35
        gboolean has_credentials;
35
36
        SyncdaemonCredentials *credentials;
36
37
};
55
56
                        g_object_unref (G_OBJECT (auth->priv->credentials));
56
57
                if (auth->priv->proxy != NULL)
57
58
                        g_object_unref (G_OBJECT (auth->priv->proxy));
 
59
                if (auth->priv->newer_proxy != NULL)
 
60
                        g_object_unref (G_OBJECT (auth->priv->newer_proxy));
58
61
                if (auth->priv->bus != NULL)
59
62
                        dbus_g_connection_unref (auth->priv->bus);
60
63
 
192
195
                        dbus_g_proxy_connect_signal (auth->priv->proxy, "CredentialsError",
193
196
                                                     G_CALLBACK (credentials_error_cb), auth, NULL);
194
197
                } else
195
 
                        g_warning ("Couldn't get proxy for com.ubuntu.sso");
 
198
                        g_warning ("Couldn't get proxy for com.ubuntu.sso.ApplicationCredentials");
 
199
 
 
200
                auth->priv->newer_proxy = dbus_g_proxy_new_for_name (auth->priv->bus, "com.ubuntu.sso",
 
201
                                                               "/com/ubuntu/sso/credentials", "com.ubuntu.sso.CredentialsManagement");
 
202
                if (auth->priv->newer_proxy != NULL) {
 
203
                        dbus_g_object_register_marshaller (_syncdaemon_marshal_VOID__STRING_POINTER,
 
204
                                                           G_TYPE_NONE,
 
205
                                                           G_TYPE_STRING,
 
206
                                                           dbus_g_type_get_map ("GHashTable",
 
207
                                                                                G_TYPE_STRING,
 
208
                                                                                G_TYPE_STRING),
 
209
                                                           G_TYPE_INVALID);
 
210
 
 
211
                        dbus_g_proxy_add_signal (auth->priv->newer_proxy, "CredentialsFound",
 
212
                                                 G_TYPE_STRING,
 
213
                                                 dbus_g_type_get_map ("GHashTable",
 
214
                                                                      G_TYPE_STRING,
 
215
                                                                      G_TYPE_STRING),
 
216
                                                 G_TYPE_INVALID);
 
217
                        dbus_g_proxy_connect_signal (auth->priv->newer_proxy, "CredentialsFound",
 
218
                                                     G_CALLBACK (credentials_found_cb), auth, NULL);
 
219
                } else
 
220
                        g_warning ("Couldn't get proxy for com.ubuntu.sso.CredentialsManagement");
 
221
 
196
222
        }
197
223
}
198
224