[gnome-online-accounts] telepathy: implement build_object
- From: Marco Barisione <mbari src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-online-accounts] telepathy: implement build_object
- Date: Thu, 22 Aug 2013 14:18:34 +0000 (UTC)
commit 9bc60ac1d0cfbf287aa98df9fddb6a3c3d9c1e02
Author: Marco Barisione <marco barisione collabora co uk>
Date: Tue Jul 9 08:42:52 2013 +0100
telepathy: implement build_object
https://bugzilla.gnome.org/show_bug.cgi?id=696267
src/goabackend/goatelepathyprovider.c | 37 ++++++++++++++++++++++++++++++++-
1 files changed, 36 insertions(+), 1 deletions(-)
---
diff --git a/src/goabackend/goatelepathyprovider.c b/src/goabackend/goatelepathyprovider.c
index 09ee533..270f1b5 100644
--- a/src/goabackend/goatelepathyprovider.c
+++ b/src/goabackend/goatelepathyprovider.c
@@ -121,8 +121,13 @@ build_object (GoaProvider *provider,
gboolean just_added,
GError **error)
{
+ GoaAccount *account;
+ GoaChat *chat;
+ gboolean chat_enabled;
gboolean ret;
+ account = NULL;
+ chat = NULL;
ret = FALSE;
/* Chain up */
@@ -135,9 +140,39 @@ build_object (GoaProvider *provider,
error))
goto out;
- /* ret = TRUE; */
+ account = goa_object_get_account (GOA_OBJECT (object));
+
+ /* Chat */
+ chat = goa_object_get_chat (GOA_OBJECT (object));
+ chat_enabled = g_key_file_get_boolean (key_file, group, "ChatEnabled", NULL);
+ if (chat_enabled)
+ {
+ if (chat == NULL)
+ {
+ chat = goa_chat_skeleton_new ();
+ goa_object_skeleton_set_chat (object, chat);
+ }
+ }
+ else
+ {
+ if (chat != NULL)
+ goa_object_skeleton_set_chat (object, NULL);
+ }
+
+ if (just_added)
+ {
+ goa_account_set_chat_disabled (account, !chat_enabled);
+ g_signal_connect (account,
+ "notify::chat-disabled",
+ G_CALLBACK (goa_util_account_notify_property_cb),
+ "ChatEnabled");
+ }
+
+ ret = TRUE;
out:
+ g_clear_object (&chat);
+ g_clear_object (&account);
return ret;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]