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:
parent
cd53f1b5a4
commit
3c3fb030bc
1 changed files with 37 additions and 0 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue