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"
|
,"event_id version 4"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// de-facto device id
|
||||||
|
const rule<> device_id
|
||||||
|
{
|
||||||
|
device_sigil >> localpart
|
||||||
|
,"device_id (de facto)"
|
||||||
|
};
|
||||||
|
|
||||||
/// (Appendix 4.1) Server Name
|
/// (Appendix 4.1) Server Name
|
||||||
/// A homeserver is uniquely identified by its server name. This value
|
/// A homeserver is uniquely identified by its server name. This value
|
||||||
/// is used in a number of identifiers, as described below. The server
|
/// is used in a number of identifiers, as described below. The server
|
||||||
|
@ -159,6 +166,7 @@ ircd::m::id::parser
|
||||||
(prefix >> ':' >> server_name)
|
(prefix >> ':' >> server_name)
|
||||||
| event_id_v4
|
| event_id_v4
|
||||||
| event_id_v3
|
| event_id_v3
|
||||||
|
| device_id
|
||||||
,"mxid"
|
,"mxid"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -584,7 +592,12 @@ ircd::m::id::id(const enum sigil &sigil,
|
||||||
static const auto &dict{rand::dict::alnum};
|
static const auto &dict{rand::dict::alnum};
|
||||||
const mutable_buffer dst{tmp_buf[0], 10};
|
const mutable_buffer dst{tmp_buf[0], 10};
|
||||||
name = rand::string(dst, dict);
|
name = rand::string(dst, dict);
|
||||||
break;
|
return fmt::sprintf
|
||||||
|
{
|
||||||
|
buf, "%c%s",
|
||||||
|
char(sigil),
|
||||||
|
name,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -121,12 +121,6 @@ post__login_password(client &client,
|
||||||
m::id::device::buf{m::id::generate, my_host()}
|
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];
|
char access_token_buf[32];
|
||||||
const string_view access_token
|
const string_view access_token
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue