Skip to content

Commit

Permalink
modules/console: Add remote arg, use params for join cmd.
Browse files Browse the repository at this point in the history
  • Loading branch information
jevolk committed Mar 27, 2023
1 parent ffecc8b commit 5303e17
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions modules/console.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
param["event_id"]
};

const string_view remote
{
param["remote"]
};

const vector_view<const string_view> remotes
{
token(line, ' ', 2, {})
&remote, 1
};

switch(m::sigil(room_id_or_alias))
Expand All @@ -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;
Expand Down

0 comments on commit 5303e17

Please sign in to comment.