mirror of
https://github.com/matrix-construct/construct
synced 2024-06-03 02:28:55 +02:00
modules/console: Add remote arg, use params for join cmd.
This commit is contained in:
parent
ffecc8bd22
commit
5303e170d3
|
@ -12342,19 +12342,34 @@ console_cmd__room__msghtml(opt &out, const string_view &line)
|
||||||
bool
|
bool
|
||||||
console_cmd__room__join(opt &out, const string_view &line)
|
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
|
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))
|
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
|
const auto join_event
|
||||||
{
|
{
|
||||||
m::join(room, user_id)
|
m::join(room, user_id, remotes)
|
||||||
};
|
};
|
||||||
|
|
||||||
out << join_event << std::endl;
|
out << join_event << std::endl;
|
||||||
|
|
Loading…
Reference in a new issue