-
- struct json_object* push_obj = json_object_new_object();
- hs_add_object_to_json_object_str( push_obj, 2,
- _application_name, value);
- afb_event_push(event_list[hs_search_event_name_index(__FUNCTION__)].event, push_obj);
+ // first step get appid from appname, next step change appname to appid
+ std::string appid(value);
+ std::transform(appid.begin(), appid.end(), appid.begin(), ::tolower);
+ HS_Client* client = g_client_manager->find(appid);
+ if(client != nullptr) {
+ if(client->tap_shortcut(value) != 0) {
+ afb_req_fail_f(request, "afb_event_push failed", "called %s.", __FUNCTION__);
+ return;
+ }
+ }
+ else {
+ // app is not started, do nothing
+ }