aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/homescreen.cpp1
-rw-r--r--src/hs-client.cpp8
-rw-r--r--src/hs-helper.h1
3 files changed, 8 insertions, 2 deletions
diff --git a/src/homescreen.cpp b/src/homescreen.cpp
index db739ee..3bcbf2c 100644
--- a/src/homescreen.cpp
+++ b/src/homescreen.cpp
@@ -31,6 +31,7 @@ const char _display_message[] = "display_message";
const char _reply_message[] = "reply_message";
const char _args[] = "args";
const char _parameter[] = "parameter";
+const char _area[] = "area";
static HS_ClientManager* g_client_manager = HS_ClientManager::instance();
diff --git a/src/hs-client.cpp b/src/hs-client.cpp
index b2f9215..c33144c 100644
--- a/src/hs-client.cpp
+++ b/src/hs-client.cpp
@@ -205,7 +205,9 @@ int HS_Client::allocateRestriction(struct afb_req request, const char* area)
struct json_object* push_obj = json_object_new_object();
hs_add_object_to_json_object_str( push_obj, 4, _application_name, "restriction",
_type, __FUNCTION__);
- json_object_object_add(push_obj, _args, json_tokener_parse(area));
+ struct json_object* area_obj;
+ json_object_object_get_ex(json_tokener_parse(area), _area, &area_obj);
+ json_object_object_add(push_obj, _area, area_obj);
afb_event_push(my_event, push_obj);
return 0;
}
@@ -229,7 +231,9 @@ int HS_Client::releaseRestriction(struct afb_req request, const char* area)
struct json_object* push_obj = json_object_new_object();
hs_add_object_to_json_object_str( push_obj, 4, _application_name, "restriction",
_type, __FUNCTION__);
- json_object_object_add(push_obj, _args, json_tokener_parse(area));
+ struct json_object* area_obj;
+ json_object_object_get_ex(json_tokener_parse(area), _area, &area_obj);
+ json_object_object_add(push_obj, _area, area_obj);
afb_event_push(my_event, push_obj);
return 0;
}
diff --git a/src/hs-helper.h b/src/hs-helper.h
index b2354e0..5cb795d 100644
--- a/src/hs-helper.h
+++ b/src/hs-helper.h
@@ -36,6 +36,7 @@ extern const char _display_message[];
extern const char _reply_message[];
extern const char _args[];
extern const char _parameter[];
+extern const char _area[];
REQ_ERROR get_value_uint16(const struct afb_req request, const char *source, uint16_t *out_id);
REQ_ERROR get_value_int16(const struct afb_req request, const char *source, int16_t *out_id);