diff options
author | David Zeuthen <davidz@redhat.com> | 2009-01-12 17:36:39 -0500 |
---|---|---|
committer | David Zeuthen <davidz@redhat.com> | 2009-01-12 17:36:39 -0500 |
commit | 0419810f86c9c0169848f1b7b045e7adcba179f2 (patch) | |
tree | a85b0de7be093f1d4f563c74f08b8d4ff4440e9e | |
parent | f6368c98e2081d0f76906004ece081b66a1bc370 (diff) |
add egg_dbus_method_invocation_get_caller()
-rw-r--r-- | src/eggdbus/eggdbusmethodinvocation.c | 18 | ||||
-rw-r--r-- | src/eggdbus/eggdbusmethodinvocation.h | 2 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/eggdbus/eggdbusmethodinvocation.c b/src/eggdbus/eggdbusmethodinvocation.c index 309bfa4..b15397c 100644 --- a/src/eggdbus/eggdbusmethodinvocation.c +++ b/src/eggdbus/eggdbusmethodinvocation.c @@ -199,6 +199,24 @@ egg_dbus_method_invocation_get_connection (EggDBusMethodInvocation *method_invoc } /** + * egg_dbus_method_invocation_get_caller: + * @method_invocation: A #EggDBusMethodInvocation. + * + * Gets the unique bus name of the caller of the method. + * + * Returns: The unique bus name of the caller. Do not free, the returned string is owned by @method_invocation. + **/ +const gchar * +egg_dbus_method_invocation_get_caller (EggDBusMethodInvocation *method_invocation) +{ + EggDBusMethodInvocationPrivate *priv; + + priv = EGG_DBUS_METHOD_INVOCATION_GET_PRIVATE (method_invocation); + + return egg_dbus_message_get_sender (priv->request_message); +} + +/** * egg_dbus_method_invocation_add_destroy_notify: * @method_invocation: A #EggDBusMethodInvocation. * @data: Data to free. diff --git a/src/eggdbus/eggdbusmethodinvocation.h b/src/eggdbus/eggdbusmethodinvocation.h index 1b4e36e..84f4d37 100644 --- a/src/eggdbus/eggdbusmethodinvocation.h +++ b/src/eggdbus/eggdbusmethodinvocation.h @@ -71,6 +71,8 @@ EggDBusMessage *egg_dbus_method_invocation_create_reply_message (EggDBusM EggDBusConnection *egg_dbus_method_invocation_get_connection (EggDBusMethodInvocation *method_invocation); +const gchar *egg_dbus_method_invocation_get_caller (EggDBusMethodInvocation *method_invocation); + void egg_dbus_method_invocation_add_destroy_notify (EggDBusMethodInvocation *method_invocation, gpointer data, GDestroyNotify func); |