refactor: rename DTree to DValue
This commit is contained in:
@@ -8,9 +8,9 @@ String clean_chat_field(String raw, u32 max_length)
|
||||
return(value);
|
||||
}
|
||||
|
||||
DTree chat_event(Request& context, String type, String body)
|
||||
DValue chat_event(Request& context, String type, String body)
|
||||
{
|
||||
DTree event;
|
||||
DValue event;
|
||||
event["type"] = type;
|
||||
event["body"] = body;
|
||||
event["connection_id"] = context.params["WS_CONNECTION_ID"];
|
||||
@@ -159,7 +159,7 @@ WS(Request& context)
|
||||
return;
|
||||
}
|
||||
|
||||
DTree payload = json_decode(context.in);
|
||||
DValue payload = json_decode(context.in);
|
||||
String type = clean_chat_field(payload["type"].to_string(), 24);
|
||||
String name = clean_chat_field(payload["name"].to_string(), 32);
|
||||
String body = clean_chat_field(payload["body"].to_string(), 500);
|
||||
@@ -183,7 +183,7 @@ WS(Request& context)
|
||||
context.connection["last_type"] = type;
|
||||
context.connection["last_body"] = body;
|
||||
context.connection["message_count"] = (f64)(message_count + 1);
|
||||
DTree event = chat_event(context, "message", body);
|
||||
DValue event = chat_event(context, "message", body);
|
||||
ws_send(json_encode(event));
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user