diff --git a/libdc/include/dc/gateway.h b/libdc/include/dc/gateway.h index ae18e16..de1abd8 100644 --- a/libdc/include/dc/gateway.h +++ b/libdc/include/dc/gateway.h @@ -12,6 +12,7 @@ struct dc_gateway_; typedef struct dc_gateway_ *dc_gateway_t; typedef enum { + GATEWAY_OPCODE_EVENT = 0, GATEWAY_OPCODE_PING = 1, GATEWAY_OPCODE_IDENTIFY = 2, GATEWAY_OPCODE_UPDATE = 3, diff --git a/libdc/src/gateway.c b/libdc/src/gateway.c index 39aafa8..850a6dd 100644 --- a/libdc/src/gateway.c +++ b/libdc/src/gateway.c @@ -228,6 +228,11 @@ static bool dc_gateway_handle_update(dc_gateway_t gw, json_t *d) return true; } +static bool dc_gateway_handle_event(dc_gateway_t gw, json_t *d) +{ + return true; +} + static bool dc_gateway_handle_op(dc_gateway_t gw, json_t *j) { json_t *val = NULL; @@ -241,6 +246,7 @@ static bool dc_gateway_handle_op(dc_gateway_t gw, json_t *j) return_if_true(val == NULL || !json_is_object(val), false); switch (op) { + case GATEWAY_OPCODE_EVENT: dc_gateway_handle_event(gw, val); break; case GATEWAY_OPCODE_HELLO: dc_gateway_handle_hello(gw, val); break; case GATEWAY_OPCODE_UPDATE: dc_gateway_handle_update(gw, val); break; case GATEWAY_OPCODE_PONG: break;