summaryrefslogtreecommitdiff
path: root/src/eggdbus/eggdbusmethodinvocation.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/eggdbus/eggdbusmethodinvocation.c')
-rw-r--r--src/eggdbus/eggdbusmethodinvocation.c18
1 files changed, 18 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.