summaryrefslogtreecommitdiffstats
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-08-02 13:53:48 +0200
commitdd8eac838b734e6f88206389f555f979ac66ae2a (patch)
treea44ab29d4ad28f6f98ed2f24dca92811f7060589
parent3eefd4308167bac1f24c014618b1ba16cd055b63 (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;
}
/*