summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/eggdbus/eggdbusmethodinvocation.c18
-rw-r--r--src/eggdbus/eggdbusmethodinvocation.h2
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);