summaryrefslogtreecommitdiffstats
path: root/glib
diff options
context:
space:
mode:
Diffstat (limited to 'glib')
-rw-r--r--glib/dbus-gobject.c28
-rw-r--r--glib/examples/example-service.c2
-rw-r--r--glib/examples/example-signal-emitter.c2
-rw-r--r--glib/examples/statemachine/statemachine-server.c2
4 files changed, 28 insertions, 6 deletions
diff --git a/glib/dbus-gobject.c b/glib/dbus-gobject.c
index 1abe2581..0a019cc2 100644
--- a/glib/dbus-gobject.c
+++ b/glib/dbus-gobject.c
@@ -1858,6 +1858,28 @@ dbus_g_object_register_marshaller_array (GClosureMarshal marshaller,
g_static_rw_lock_writer_unlock (&globals_lock);
}
+/**
+ * Get the sender of a message so we can send a
+ * "reply" later (i.e. send a message directly
+ * to a service which invoked the method at a
+ * later time).
+ *
+ * @param context the method context
+ *
+ * @return the unique name of teh sender
+ */
+gchar *
+dbus_g_method_get_sender (DBusGMethodInvocation *context)
+{
+ const gchar *sender;
+
+ sender = dbus_message_get_sender (dbus_g_message_get_message (context->message));
+
+ if (sender == NULL)
+ return NULL;
+
+ return strdup (sender);
+}
/**
* Get the reply message to append reply values
@@ -1867,9 +1889,9 @@ dbus_g_object_register_marshaller_array (GClosureMarshal marshaller,
* @param context the method context
*/
DBusMessage *
-dbus_g_method_return_get_reply (DBusGMethodInvocation *context)
+dbus_g_method_get_reply (DBusGMethodInvocation *context)
{
- return dbus_message_new_method_return (dbus_g_message_get_message (context->message));
+ return dbus_message_new_method_return (dbus_g_message_get_message (context->message));
}
/**
@@ -1881,7 +1903,7 @@ dbus_g_method_return_get_reply (DBusGMethodInvocation *context)
* @param reply the reply message, will be unreffed
*/
void
-dbus_g_method_return_send_reply (DBusGMethodInvocation *context, DBusMessage *reply)
+dbus_g_method_send_reply (DBusGMethodInvocation *context, DBusMessage *reply)
{
dbus_connection_send (dbus_g_connection_get_connection (context->connection), reply, NULL);
dbus_message_unref (reply);
diff --git a/glib/examples/example-service.c b/glib/examples/example-service.c
index 5e58175f..a66855c1 100644
--- a/glib/examples/example-service.c
+++ b/glib/examples/example-service.c
@@ -135,7 +135,7 @@ main (int argc, char **argv)
if (!dbus_g_proxy_call (bus_proxy, "RequestName", &error,
G_TYPE_STRING, "org.designfu.SampleService",
- G_TYPE_UINT, DBUS_NAME_FLAG_PROHIBIT_REPLACEMENT,
+ G_TYPE_UINT, 0,
G_TYPE_INVALID,
G_TYPE_UINT, &request_name_result,
G_TYPE_INVALID))
diff --git a/glib/examples/example-signal-emitter.c b/glib/examples/example-signal-emitter.c
index d1cc444c..c60865d2 100644
--- a/glib/examples/example-signal-emitter.c
+++ b/glib/examples/example-signal-emitter.c
@@ -114,7 +114,7 @@ main (int argc, char **argv)
if (!dbus_g_proxy_call (bus_proxy, "RequestName", &error,
G_TYPE_STRING, "org.designfu.TestService",
- G_TYPE_UINT, DBUS_NAME_FLAG_PROHIBIT_REPLACEMENT,
+ G_TYPE_UINT, 0,
G_TYPE_INVALID,
G_TYPE_UINT, &request_name_result,
G_TYPE_INVALID))
diff --git a/glib/examples/statemachine/statemachine-server.c b/glib/examples/statemachine/statemachine-server.c
index 2cbf39fe..cc9ca4bd 100644
--- a/glib/examples/statemachine/statemachine-server.c
+++ b/glib/examples/statemachine/statemachine-server.c
@@ -211,7 +211,7 @@ main (int argc, char **argv)
if (!dbus_g_proxy_call (bus_proxy, "RequestName", &error,
G_TYPE_STRING, "com.example.StateServer",
- G_TYPE_UINT, DBUS_NAME_FLAG_PROHIBIT_REPLACEMENT,
+ G_TYPE_UINT, 0,
G_TYPE_INVALID,
G_TYPE_UINT, &request_name_result,
G_TYPE_INVALID))