mirror of
https://github.com/matrix-construct/construct
synced 2024-10-02 21:59:02 +02:00
modules/console: Use m::room_id() for room id cmd.
This commit is contained in:
parent
4ab2623ef2
commit
2d928bfa4a
1 changed files with 2 additions and 18 deletions
|
@ -9890,24 +9890,8 @@ console_cmd__room__create(opt &out, const string_view &line)
|
|||
bool
|
||||
console_cmd__room__id(opt &out, const string_view &id)
|
||||
{
|
||||
if(m::has_sigil(id)) switch(m::sigil(id))
|
||||
{
|
||||
case m::id::USER:
|
||||
out << m::user{id}.room_id() << std::endl;
|
||||
return true;
|
||||
|
||||
case m::id::ROOM_ALIAS:
|
||||
out << m::room_id(m::room::alias(id)) << std::endl;
|
||||
return true;
|
||||
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
else if(rfc3986::valid_remote(std::nothrow, id))
|
||||
{
|
||||
out << m::node{id}.room_id() << std::endl;
|
||||
return true;
|
||||
}
|
||||
out << m::room_id(id)
|
||||
<< std::endl;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue