r6933 - dumbhippo/trunk/client/linux/src
- From: commits mugshot org
- To: online-desktop-list gnome org
- Subject: r6933 - dumbhippo/trunk/client/linux/src
- Date: Mon, 19 Nov 2007 16:11:13 -0600 (CST)
Author: hp
Date: 2007-11-19 16:11:12 -0600 (Mon, 19 Nov 2007)
New Revision: 6933
Modified:
dumbhippo/trunk/client/linux/src/hippo-dbus-model-client.c
dumbhippo/trunk/client/linux/src/hippo-dbus-model-client.h
dumbhippo/trunk/client/linux/src/hippo-dbus-model.c
dumbhippo/trunk/client/linux/src/hippo-im.c
Log:
add contact property to buddies, and fix a crash where closure->client->connection was null in hippo-dbus-model-client.c:on_update_success
Modified: dumbhippo/trunk/client/linux/src/hippo-dbus-model-client.c
===================================================================
--- dumbhippo/trunk/client/linux/src/hippo-dbus-model-client.c 2007-11-19 21:55:57 UTC (rev 6932)
+++ dumbhippo/trunk/client/linux/src/hippo-dbus-model-client.c 2007-11-19 22:11:12 UTC (rev 6933)
@@ -42,6 +42,7 @@
struct _DataClientQueryClosure {
HippoDBusModelClient *client;
+ DBusConnection *connection;
DBusMessage *message;
DDMDataFetch *fetch;
};
@@ -90,11 +91,13 @@
static DataClientQueryClosure *
data_client_query_closure_new (HippoDBusModelClient *client,
+ DBusConnection *connection,
DBusMessage *message,
DDMDataFetch *fetch)
{
DataClientQueryClosure *closure = g_new0(DataClientQueryClosure, 1);
closure->client = client ? g_object_ref(client) : NULL;
+ closure->connection = connection ? dbus_connection_ref(connection) : NULL;
closure->message = dbus_message_ref(message);
closure->fetch = fetch ? ddm_data_fetch_ref(fetch) : NULL;
@@ -108,6 +111,8 @@
g_object_unref(closure->client);
if (closure->fetch)
ddm_data_fetch_unref(closure->fetch);
+ if (closure->connection)
+ dbus_connection_unref(closure->connection);
dbus_message_unref(closure->message);
g_free(closure);
}
@@ -603,7 +608,7 @@
g_return_val_if_fail(HIPPO_IS_DBUS_MODEL_CLIENT(client), FALSE);
g_return_val_if_fail(!client->disconnected, FALSE);
- closure = data_client_query_closure_new(client, message, fetch);
+ closure = data_client_query_closure_new(client, client->connection, message, fetch);
fetch_string = ddm_data_fetch_to_string(fetch);
query = ddm_data_model_query_params(client->model, method_uri, fetch_string, params);
@@ -629,7 +634,7 @@
DBusMessage *reply;
reply = dbus_message_new_method_return(closure->message);
- dbus_connection_send(closure->client->connection, reply, NULL);
+ dbus_connection_send(closure->connection, reply, NULL);
dbus_message_unref(reply);
data_client_query_closure_destroy(closure);
@@ -637,6 +642,7 @@
gboolean
hippo_dbus_model_client_do_update (DDMDataModel *model,
+ DBusConnection *connection,
DBusMessage *message,
const char *method_uri,
GHashTable *params)
@@ -644,7 +650,7 @@
DataClientQueryClosure *closure;
DDMDataQuery *query;
- closure = data_client_query_closure_new(NULL, message, NULL);
+ closure = data_client_query_closure_new(NULL, connection, message, NULL);
query = ddm_data_model_update_params(model, method_uri, params);
if (query == NULL) {
Modified: dumbhippo/trunk/client/linux/src/hippo-dbus-model-client.h
===================================================================
--- dumbhippo/trunk/client/linux/src/hippo-dbus-model-client.h 2007-11-19 21:55:57 UTC (rev 6932)
+++ dumbhippo/trunk/client/linux/src/hippo-dbus-model-client.h 2007-11-19 22:11:12 UTC (rev 6933)
@@ -43,6 +43,7 @@
* here because of it's close connection to do_query()
*/
gboolean hippo_dbus_model_client_do_update (DDMDataModel *model,
+ DBusConnection *connection,
DBusMessage *message,
const char *method_uri,
GHashTable *params);
Modified: dumbhippo/trunk/client/linux/src/hippo-dbus-model.c
===================================================================
--- dumbhippo/trunk/client/linux/src/hippo-dbus-model.c 2007-11-19 21:55:57 UTC (rev 6932)
+++ dumbhippo/trunk/client/linux/src/hippo-dbus-model.c 2007-11-19 22:11:12 UTC (rev 6933)
@@ -265,7 +265,9 @@
DBUS_ERROR_INVALID_ARGS,
_("Too many arguments"));
- if (!hippo_dbus_model_client_do_update(model, message, method_uri, params)) {
+ if (!hippo_dbus_model_client_do_update(model,
+ hippo_dbus_get_connection(hippo_app_get_dbus(hippo_get_app())),
+ message, method_uri, params)) {
/* We've already validated most arguments, so don't worry too much about getting a
* good error message if something goes wrong at this point
*/
Modified: dumbhippo/trunk/client/linux/src/hippo-im.c
===================================================================
--- dumbhippo/trunk/client/linux/src/hippo-im.c 2007-11-19 21:55:57 UTC (rev 6932)
+++ dumbhippo/trunk/client/linux/src/hippo-im.c 2007-11-19 22:11:12 UTC (rev 6933)
@@ -78,6 +78,16 @@
"(source.xmpp = target.name and target.protocol = 'xmpp') or "
"(source = target.name and target.protocol = 'mugshot-local')");
+ /* Add contact property to buddies */
+ ddm_data_model_add_rule(model,
+ "online-desktop:/p/o/buddy",
+ "online-desktop:/p/o/buddy#contact",
+ "http://online.gnome.org/p/o/contact",
+ DDM_DATA_CARDINALITY_01, FALSE, NULL,
+ "(source.aims = target.name and target.protocol = 'aim') or "
+ "(source.xmpps = target.name and target.protocol = 'xmpp') or "
+ "(source = target.name and target.protocol = 'mugshot-local')");
+
/* Add aimBuddy property to users */
ddm_data_model_add_rule(model,
"http://mugshot.org/p/o/user",
@@ -108,8 +118,16 @@
"online-desktop:/p/o/buddy/reverse#aimBuddies",
"online-desktop:/p/o/buddy",
DDM_DATA_CARDINALITY_N, FALSE, NULL,
- "source.name = target.aims and source.protocol = 'aim' and not source.deleted");
+ "source.name = target.aims and source.protocol = 'aim' and not source.deleted");
+ /* Add xmppBuddies property to contacts */
+ ddm_data_model_add_rule(model,
+ "http://online.gnome.org/p/o/contact",
+ "online-desktop:/p/o/buddy/reverse#xmppBuddies",
+ "online-desktop:/p/o/buddy",
+ DDM_DATA_CARDINALITY_N, FALSE, NULL,
+ "source.name = target.xmpps and source.protocol = 'xmpp' and not source.deleted");
+
/* Add aimBuddies property to global object */
ddm_data_model_add_rule(model,
"online-desktop:/p/o/global",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]