0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-09-26 02:18:53 +02:00

ircd:Ⓜ️:room::power: Fix m.room.power_levels format validation per the spec.

This commit is contained in:
Jason Volk 2019-02-14 12:51:33 -08:00
parent f48274fc58
commit 30d27df649

View file

@ -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