0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 23:44:01 +01:00

ircd:Ⓜ️🆔 Fix v3 / v4 validation false negative on construction.

This commit is contained in:
Jason Volk 2020-04-03 11:30:37 -07:00
parent a7d9476a05
commit 47deac63d3

View file

@ -732,7 +732,7 @@ const
ircd::m::id::event::v3::v3(const string_view &id) ircd::m::id::event::v3::v3(const string_view &id)
:id::event{id} :id::event{id}
{ {
if(unlikely(version() != "3")) if(unlikely(!is(id)))
throw m::INVALID_MXID throw m::INVALID_MXID
{ {
"'%s' is not a version 3 event mxid; maybe version %s?", "'%s' is not a version 3 event mxid; maybe version %s?",
@ -803,7 +803,7 @@ noexcept
ircd::m::id::event::v4::v4(const string_view &id) ircd::m::id::event::v4::v4(const string_view &id)
:id::event{id} :id::event{id}
{ {
if(unlikely(version() != "4")) if(unlikely(!is(id)))
throw m::INVALID_MXID throw m::INVALID_MXID
{ {
"'%s' is not a version 4 event mxid; maybe version %s?", "'%s' is not a version 4 event mxid; maybe version %s?",