From 47deac63d3dd60626756ff04383afdb711bc28d7 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Fri, 3 Apr 2020 11:30:37 -0700 Subject: [PATCH] ircd::m::id: Fix v3 / v4 validation false negative on construction. --- matrix/id.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/matrix/id.cc b/matrix/id.cc index 4fefb08c1..64f271aed 100644 --- a/matrix/id.cc +++ b/matrix/id.cc @@ -732,7 +732,7 @@ const ircd::m::id::event::v3::v3(const string_view &id) :id::event{id} { - if(unlikely(version() != "3")) + if(unlikely(!is(id))) throw m::INVALID_MXID { "'%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) :id::event{id} { - if(unlikely(version() != "4")) + if(unlikely(!is(id))) throw m::INVALID_MXID { "'%s' is not a version 4 event mxid; maybe version %s?",