From 30d27df6491126e908380a7fabd17df1b995af52 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Thu, 14 Feb 2019 12:51:33 -0800 Subject: [PATCH] ircd::m::room::power: Fix m.room.power_levels format validation per the spec. --- ircd/m_room.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ircd/m_room.cc b/ircd/m_room.cc index ed25cb0bb..e1fb22b46 100644 --- a/ircd/m_room.cc +++ b/ircd/m_room.cc @@ -2399,7 +2399,7 @@ const try const string_view &level { - events.at(type) + unquote(events.at(type)) }; ret = json::type(level) == json::NUMBER; @@ -2427,7 +2427,7 @@ const try const string_view &level { - users.at(user_id) + unquote(users.at(user_id)) }; ret = json::type(level) == json::NUMBER; @@ -2464,7 +2464,7 @@ const view([&prop, &ret] (const json::object &content) { - const auto &value{content.get(prop)}; + const auto &value(unquote(content.get(prop))); if(value && json::type(value) == json::NUMBER) ret = true; }); @@ -2522,7 +2522,7 @@ const for(auto it(begin(collection)); it != end(collection) && ret; ++it) { const auto &member(*it); - if(json::type(member.second) != json::NUMBER) + if(json::type(unquote(member.second)) != json::NUMBER) continue; const auto &key