ircd:Ⓜ️🆔 de facto device id.
This commit is contained in:
parent
fa0365fa31
commit
15cb6bfdca
15
matrix/id.cc
15
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:
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue