Revision 1d31e31f events.c

View differences:

events.c
15 15
#include "events.h"
16 16
#include "utils.h"
17 17

  
18
static gboolean eventsenabled = FALSE;
18 19
static GHashTable *eventhandlers = NULL;
19
void janus_events_init(GHashTable *handlers) {
20
void janus_events_init(gboolean enabled, GHashTable *handlers) {
21
	eventsenabled = enabled;
20 22
	eventhandlers = handlers;
21 23
}
22 24

  
25
gboolean janus_events_is_enabled(void) {
26
	return eventsenabled;
27
}
28

  
23 29
void janus_events_notify_handlers(int type, guint64 session_id, ...) {
24
	if(eventhandlers == NULL || g_hash_table_size(eventhandlers) == 0)
30
	if(!eventsenabled || eventhandlers == NULL || g_hash_table_size(eventhandlers) == 0)
25 31
		return;
26 32

  
27 33
	/* Prepare the event to notify as a Jansson json_t object */

Also available in: Unified diff