0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-23 22:13:55 +01:00

modules/console: Add room msghtml cmd.

This commit is contained in:
Jason Volk 2023-01-28 19:46:43 -08:00
parent cd53f1b5a4
commit 3c3fb030bc

View file

@ -12071,6 +12071,43 @@ console_cmd__room__message(opt &out, const string_view &line)
return true;
}
bool
console_cmd__room__msghtml(opt &out, const string_view &line)
{
const params param{line, " ",
{
"room_id", "user_id"
}};
const auto room_id
{
m::room_id(param.at("room_id"))
};
const m::user::id sender
{
param.at("user_id")
};
const string_view body
{
tokens_after(line, ' ', 1)
};
const m::room room
{
room_id
};
const auto event_id
{
msghtml(room, sender, body, body, "m.text")
};
out << event_id << std::endl;
return true;
}
bool
console_cmd__room__join(opt &out, const string_view &line)
{