[gdm/wip/wayland-at-login-screen: 67/70] session: add way to get session id for specific conversation



commit df40211efc09fdc88f3f54c3fc003ebc16cfe0c0
Author: Ray Strode <rstrode redhat com>
Date:   Tue Feb 17 21:42:54 2015 -0500

    session: add way to get session id for specific conversation
    
    Right now, the only way to find out the session id of an opened
    (but not started) session is a parameter in the session-opened
    handler.
    
    This commit adds a new function
    gdm_session_get_conversation_session_id that returns the session-id
    for a specified opened conversation.

 daemon/gdm-session.c |   17 +++++++++++++++++
 daemon/gdm-session.h |    2 ++
 2 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
index 3d0fd7c..39b7737 100644
--- a/daemon/gdm-session.c
+++ b/daemon/gdm-session.c
@@ -2826,6 +2826,23 @@ gdm_session_get_session_id (GdmSession *self)
         return conversation->session_id;
 }
 
+const char *
+gdm_session_get_conversation_session_id (GdmSession *self,
+                                         const char *service_name)
+{
+        GdmSessionConversation *conversation;
+
+        g_return_val_if_fail (GDM_IS_SESSION (self), NULL);
+
+        conversation = find_conversation_by_name (self, service_name);
+
+        if (conversation == NULL) {
+                return NULL;
+        }
+
+        return conversation->session_id;
+}
+
 static char *
 get_session_filename (GdmSession *self)
 {
diff --git a/daemon/gdm-session.h b/daemon/gdm-session.h
index 4e23301..6d13f11 100644
--- a/daemon/gdm-session.h
+++ b/daemon/gdm-session.h
@@ -141,6 +141,8 @@ gboolean          gdm_session_start_conversation          (GdmSession *session,
                                                            const char *service_name);
 void              gdm_session_stop_conversation           (GdmSession *session,
                                                            const char *service_name);
+const char       *gdm_session_get_conversation_session_id (GdmSession *session,
+                                                           const char *service_name);
 void              gdm_session_setup                       (GdmSession *session,
                                                            const char *service_name);
 void              gdm_session_setup_for_user              (GdmSession *session,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]