aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2017-07-31 16:25:06 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2017-07-31 16:25:06 +0200
commit11adca199df161b22b7fa387808e987e45e0b2c7 (patch)
treed6a4314b1bd7ddc29cefd4418ae198148e8f3120
parentc623236073ec6cba38a5c02582cc24ad2f5e51c4 (diff)
afb-evt: unprefix event name
Removes the api prefix of the event name. Change-Id: I050dc86beb08659751c1e57b8d3ea233bac9e411 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r--src/afb-evt.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/afb-evt.c b/src/afb-evt.c
index d80af045..20ef5e9e 100644
--- a/src/afb-evt.c
+++ b/src/afb-evt.c
@@ -213,9 +213,11 @@ static int evt_push(struct afb_evt_event *evt, struct json_object *obj)
*/
static const char *evt_name(struct afb_evt_event *evt)
{
+ const char *name = strchr(evt->name, '/');
+ name = name ? name + 1 : evt->name;
if (evt->hookflags & afb_hook_flag_evt_name)
afb_hook_evt_name(evt->name, evt->id);
- return evt->name;
+ return name;
}
/*