identity manager: support add identities in headless mode
[moonshot-ui.git] / src / moonshot-server.vala
index 24077c4..2bff71d 100644 (file)
@@ -10,6 +10,16 @@ public class MoonshotServer : Object {
         this.parent_app = app;
     }
 
+    public bool show_ui()
+    {
+        if (parent_app.view == null) {
+            return false;
+        }
+        parent_app.show();
+        parent_app.explicitly_launched = true;
+        return true;
+    }
+
     public async bool get_identity (string nai,
                                     string password,
                                     string service,
@@ -37,7 +47,7 @@ public class MoonshotServer : Object {
 
         var id_card = request.id_card;
 
-        if (id_card != null) {
+        if ((id_card != null) && (id_card.display_name != IdCard.NO_IDENTITY)) {
             nai_out = id_card.nai;
             password_out = id_card.password;