[Galago-commits] r2403 - in trunk/galago-daemon: . src
galago-commits at freedesktop.org
galago-commits at freedesktop.org
Tue Jan 10 00:41:35 PST 2006
Author: chipx86
Date: 2006-01-10 00:41:33 -0800 (Tue, 10 Jan 2006)
New Revision: 2403
Modified:
trunk/galago-daemon/ChangeLog
trunk/galago-daemon/src/account.c
trunk/galago-daemon/src/filter.h
trunk/galago-daemon/src/meta-account.c
trunk/galago-daemon/src/service.c
Log:
Compute the account object paths when adding an account to a service.
Modified: trunk/galago-daemon/ChangeLog
===================================================================
--- trunk/galago-daemon/ChangeLog 2006-01-10 08:41:16 UTC (rev 2402)
+++ trunk/galago-daemon/ChangeLog 2006-01-10 08:41:33 UTC (rev 2403)
@@ -1,3 +1,11 @@
+Tue Jan 10 00:41:18 PST 2006 Christian Hammond <chipx86 at chipx86.com>
+
+ * src/account.c:
+ * src/filter.h:
+ * src/meta-account.c:
+ * src/service.c:
+ - Compute the account object paths when adding an account to a service.
+
Tue Jan 10 00:22:18 PST 2006 Christian Hammond <chipx86 at chipx86.com>
* src/meta-presence.c:
Modified: trunk/galago-daemon/src/account.c
===================================================================
--- trunk/galago-daemon/src/account.c 2006-01-10 08:41:16 UTC (rev 2402)
+++ trunk/galago-daemon/src/account.c 2006-01-10 08:41:33 UTC (rev 2403)
@@ -570,6 +570,15 @@
GALAGOD_COMMAND_LAST
};
+char *
+galagod_account_generate_path(GalagoAccount *account)
+{
+ return g_strdup_printf("%s/%s",
+ galago_object_get_dbus_path(
+ GALAGO_OBJECT(galago_account_get_service(account))),
+ galago_dbus_normalize_name(galago_account_get_username(account)));
+}
+
void
galagod_account_add_filter(GalagoAccount *account)
{
Modified: trunk/galago-daemon/src/filter.h
===================================================================
--- trunk/galago-daemon/src/filter.h 2006-01-10 08:41:16 UTC (rev 2402)
+++ trunk/galago-daemon/src/filter.h 2006-01-10 08:41:33 UTC (rev 2403)
@@ -77,6 +77,7 @@
void galagod_service_add_filter(GalagoService *service);
void galagod_service_remove_filter(GalagoService *service);
+char *galagod_account_generate_path(GalagoAccount *account);
void galagod_account_add_filter(GalagoAccount *account);
void galagod_account_remove_filter(GalagoAccount *account);
Modified: trunk/galago-daemon/src/meta-account.c
===================================================================
--- trunk/galago-daemon/src/meta-account.c 2006-01-10 08:41:16 UTC (rev 2402)
+++ trunk/galago-daemon/src/meta-account.c 2006-01-10 08:41:33 UTC (rev 2403)
@@ -51,6 +51,7 @@
const char *username)
{
GalagodMetaAccount *meta_account;
+ char *obj_path;
g_return_val_if_fail(meta_service != NULL, NULL);
g_return_val_if_fail(meta_person != NULL, NULL);
@@ -63,6 +64,11 @@
galagod_meta_person_get_person(meta_person),
username);
+ obj_path = galagod_account_generate_path(meta_account->account);
+ galago_object_set_dbus_path(GALAGO_OBJECT(meta_account->account),
+ obj_path);
+ g_free(obj_path);
+
g_object_set_data(G_OBJECT(meta_account->account),
"meta-account", meta_account);
Modified: trunk/galago-daemon/src/service.c
===================================================================
--- trunk/galago-daemon/src/service.c 2006-01-10 08:41:16 UTC (rev 2402)
+++ trunk/galago-daemon/src/service.c 2006-01-10 08:41:33 UTC (rev 2403)
@@ -32,22 +32,33 @@
GalagodMetaService *meta_service;
GalagoPerson *person;
DBusMessageIter iter;
+ DBusMessage *reply;
+ char *obj_path;
dbus_message_iter_init(message, &iter);
account = galago_dbus_message_iter_get_object(&iter, GALAGO_TYPE_ACCOUNT);
-
g_object_set_data(G_OBJECT(account), "coco", coco);
meta_service = GALAGOD_META_SERVICE(service);
account_list = galagod_meta_service_get_account_list(meta_service);
+
+ /* Send the reply containing the object path. */
+ reply = dbus_message_new_method_return(message);
+ dbus_message_iter_init_append(reply, &iter);
+
+ obj_path = galagod_account_generate_path(account);
+ galago_object_set_dbus_path(GALAGO_OBJECT(account), obj_path);
+ dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &obj_path);
+
+ dbus_connection_send(dbus_conn, reply, NULL);
+ dbus_message_unref(reply);
+
+ g_free(obj_path);
+
galagod_account_list_add(account_list, account);
-
person = galago_account_get_person(account);
-
galagod_people_account_added(person);
- galagod_dbus_send_empty_reply(dbus_conn, message);
-
return DBUS_HANDLER_RESULT_HANDLED;
}
More information about the galago-commits
mailing list