Skip to content

Commit 5303e17

Browse files
committed
modules/console: Add remote arg, use params for join cmd.
1 parent ffecc8b commit 5303e17

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

modules/console.cc

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12342,19 +12342,34 @@ console_cmd__room__msghtml(opt &out, const string_view &line)
1234212342
bool
1234312343
console_cmd__room__join(opt &out, const string_view &line)
1234412344
{
12345+
const params param{line, " ",
12346+
{
12347+
"room_id", "user_id", "remote", "event_id"
12348+
}};
12349+
1234512350
const string_view room_id_or_alias
1234612351
{
12347-
token(line, ' ', 0)
12352+
param.at("room_id")
1234812353
};
1234912354

12350-
const m::user::id &user_id
12355+
const m::user::id user_id
1235112356
{
12352-
token(line, ' ', 1)
12357+
param.at("user_id")
1235312358
};
1235412359

12355-
const string_view &event_id
12360+
const string_view event_id
12361+
{
12362+
param["event_id"]
12363+
};
12364+
12365+
const string_view remote
12366+
{
12367+
param["remote"]
12368+
};
12369+
12370+
const vector_view<const string_view> remotes
1235612371
{
12357-
token(line, ' ', 2, {})
12372+
&remote, 1
1235812373
};
1235912374

1236012375
switch(m::sigil(room_id_or_alias))
@@ -12368,7 +12383,7 @@ console_cmd__room__join(opt &out, const string_view &line)
1236812383

1236912384
const auto join_event
1237012385
{
12371-
m::join(room, user_id)
12386+
m::join(room, user_id, remotes)
1237212387
};
1237312388

1237412389
out << join_event << std::endl;

0 commit comments

Comments
 (0)