diff --git a/matrix/id.cc b/matrix/id.cc index 095bbd43d..225a66dba 100644 --- a/matrix/id.cc +++ b/matrix/id.cc @@ -132,6 +132,13 @@ ircd::m::id::parser ,"event_id version 4" }; + // de-facto device id + const rule<> device_id + { + device_sigil >> localpart + ,"device_id (de facto)" + }; + /// (Appendix 4.1) Server Name /// A homeserver is uniquely identified by its server name. This value /// is used in a number of identifiers, as described below. The server @@ -159,6 +166,7 @@ ircd::m::id::parser (prefix >> ':' >> server_name) | event_id_v4 | event_id_v3 + | device_id ,"mxid" }; @@ -584,7 +592,12 @@ ircd::m::id::id(const enum sigil &sigil, static const auto &dict{rand::dict::alnum}; const mutable_buffer dst{tmp_buf[0], 10}; name = rand::string(dst, dict); - break; + return fmt::sprintf + { + buf, "%c%s", + char(sigil), + name, + }; } default: diff --git a/modules/client/login.cc b/modules/client/login.cc index 6251f6fb9..cc50ee242 100644 --- a/modules/client/login.cc +++ b/modules/client/login.cc @@ -121,12 +121,6 @@ post__login_password(client &client, m::id::device::buf{m::id::generate, my_host()} }; - if(!my(device_id)) - throw m::UNSUPPORTED - { - "Device ID's with foreign hostparts are not supported." - }; - char access_token_buf[32]; const string_view access_token {