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:
parent
14a20955ec
commit
9d93d1e71b
1 changed files with 14 additions and 7 deletions
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue