aboutsummaryrefslogtreecommitdiffstats
path: root/src/hs-clientmanager.cpp
diff options
context:
space:
mode:
authorwang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>2019-04-24 19:22:44 +0800
committerwang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>2019-04-24 19:22:44 +0800
commit4cb1ba39335aa2a2d2e08481acd72a3682adaefe (patch)
tree0652fc574d098cb904db455ae6522e23a354b102 /src/hs-clientmanager.cpp
parent95c8f8ac2526acc5f7467704532ea235532b1876 (diff)
send showWindow event when app start over
Change-Id: I2ced5f48f0c377cdc4261b5bb19ac6f9c40760ea
Diffstat (limited to 'src/hs-clientmanager.cpp')
-rw-r--r--src/hs-clientmanager.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/hs-clientmanager.cpp b/src/hs-clientmanager.cpp
index 1128b01..89b0ae2 100644
--- a/src/hs-clientmanager.cpp
+++ b/src/hs-clientmanager.cpp
@@ -188,7 +188,7 @@ int HS_ClientManager::handleRequest(afb_req_t request, const char *verb, const c
appid2ctxt[appid] = createClientCtxt(request, appid);
HS_Client* client = addClient(request, appid);
ret = client->handleRequest(request, "subscribe");
- HS_AppRecover::instance()->registerRecoveredApp(std::string(appid));
+ checkRegisterApp(std::string(appid));
}
else {
AFB_NOTICE("not exist session");
@@ -233,4 +233,27 @@ int HS_ClientManager::pushEvent(const char *event, struct json_object *param, st
}
return 0;
+}
+
+/**
+ * check register application
+ *
+ * #### Parameters
+ * - appid : register application's id
+ *
+ * #### Return
+ * None
+ *
+ */
+void HS_ClientManager::checkRegisterApp(const std::string &appid)
+{
+ if(HS_AppRecover::instance()->registerRecoveredApp(appid)) {
+ AFB_NOTICE("register recover application.");
+ return;
+ }
+
+ if(startup_appid == appid) {
+ startup_appid.clear();
+ pushEvent("showWindow", nullptr, appid);
+ }
} \ No newline at end of file