just add skeleton request handling

This commit is contained in:
Florian Stinglmayr 2019-07-09 21:46:17 +02:00
parent b2fc9cbb62
commit ffcc9f60f7
2 changed files with 7 additions and 0 deletions

View File

@ -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,

View File

@ -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;