0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-25 15:04:10 +01:00

modules/client/rooms/send: Use m::room::message for single pass.

This commit is contained in:
Jason Volk 2020-11-13 05:20:01 -08:00
parent 14a20955ec
commit 9d93d1e71b

View file

@ -141,15 +141,22 @@ put__send(client &client,
room_id, &copts
};
const bool cmd
if(type == "m.room.message")
{
type == "m.room.message" &&
unquote(content.get("msgtype")) == "m.text" &&
startswith(unquote(content.get("body")), "\\\\")
};
const m::room::message message
{
content
};
if(cmd)
return handle_command(client, request, room);
const bool cmd
{
json::get<"msgtype"_>(message) == "m.text" &&
startswith(json::get<"body"_>(message), "\\\\")
};
if(cmd)
return handle_command(client, request, room);
}
const auto event_id
{