modules/console: Add remote arg, use params for join cmd.

This commit is contained in:
Jason Volk 2023-03-26 20:55:09 -07:00
parent ffecc8bd22
commit 5303e170d3
1 changed files with 21 additions and 6 deletions

View File

@ -12342,19 +12342,34 @@ console_cmd__room__msghtml(opt &out, const string_view &line)
bool
console_cmd__room__join(opt &out, const string_view &line)
{
const params param{line, " ",
{
"room_id", "user_id", "remote", "event_id"
}};
const string_view room_id_or_alias
{
token(line, ' ', 0)
param.at("room_id")
};
const m::user::id &user_id
const m::user::id user_id
{
token(line, ' ', 1)
param.at("user_id")
};
const string_view &event_id
const string_view event_id
{
token(line, ' ', 2, {})
param["event_id"]
};
const string_view remote
{
param["remote"]
};
const vector_view<const string_view> remotes
{
&remote, 1
};
switch(m::sigil(room_id_or_alias))
@ -12368,7 +12383,7 @@ console_cmd__room__join(opt &out, const string_view &line)
const auto join_event
{
m::join(room, user_id)
m::join(room, user_id, remotes)
};
out << join_event << std::endl;