ircd:Ⓜ️:user::registar: Allow full mxid argument w/ localname extraction.

This commit is contained in:
Jason Volk 2020-11-16 07:17:40 -08:00
parent 119f5a88fc
commit 2aa1d6520a
1 changed files with 4 additions and 2 deletions

View File

@ -36,9 +36,11 @@ const
// 3.3.1 The local part of the desired Matrix ID. If omitted, the homeserver MUST
// generate a Matrix ID local part.
const auto &username
const string_view username
{
json::get<"username"_>(*this)
valid(m::id::USER, json::get<"username"_>(*this))?
m::id::user(json::get<"username"_>(*this)).localname():
string_view(json::get<"username"_>(*this))
};
// Generate canonical mxid. The home_server is appended if one is not