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

ircd::json: Preserve string quotes for typed comparisons here.

This commit is contained in:
Jason Volk 2019-04-24 19:19:06 -07:00
parent 5bb98356e0
commit c45353efec
2 changed files with 15 additions and 15 deletions

View file

@ -3781,7 +3781,7 @@ const
!bool(integer);
case STRING:
return string? !len || string_view{*this} == empty_string:
return string? !len || (serial && string_view{string, len} == empty_string):
true;
case OBJECT:
@ -3821,7 +3821,7 @@ const
!bool(integer);
case STRING:
return !string || !len || (serial && string_view{*this} == empty_string);
return !string || !len || (serial && string_view{string, len} == empty_string);
case OBJECT:
return serial? !len || string_view{*this} == empty_object:

View file

@ -1410,49 +1410,49 @@ ircd::m::essential(m::event event,
{
content = json::stringify(essential, json::members
{
{ "aliases", unquote(content.at("aliases")) }
{ "aliases", content.at("aliases") }
});
}
else if(type == "m.room.create")
{
content = json::stringify(essential, json::members
{
{ "creator", unquote(content.at("creator")) }
{ "creator", content.at("creator") }
});
}
else if(type == "m.room.history_visibility")
{
content = json::stringify(essential, json::members
{
{ "history_visibility", unquote(content.at("history_visibility")) }
{ "history_visibility", content.at("history_visibility") }
});
}
else if(type == "m.room.join_rules")
{
content = json::stringify(essential, json::members
{
{ "join_rule", unquote(content.at("join_rule")) }
{ "join_rule", content.at("join_rule") }
});
}
else if(type == "m.room.member")
{
content = json::stringify(essential, json::members
{
{ "membership", unquote(content.at("membership")) }
{ "membership", content.at("membership") }
});
}
else if(type == "m.room.power_levels")
{
content = json::stringify(essential, json::members
{
{ "ban", unquote(content.at("ban")) },
{ "events", unquote(content.at("events")) },
{ "events_default", unquote(content.at("events_default")) },
{ "kick", unquote(content.at("kick")) },
{ "redact", unquote(content.at("redact")) },
{ "state_default", unquote(content.at("state_default")) },
{ "users", unquote(content.at("users")) },
{ "users_default", unquote(content.at("users_default")) },
{ "ban", content.at("ban") },
{ "events", content.at("events") },
{ "events_default", content.at("events_default") },
{ "kick", content.at("kick") },
{ "redact", content.at("redact") },
{ "state_default", content.at("state_default") },
{ "users", content.at("users") },
{ "users_default", content.at("users_default") },
});
}
else if(type == "m.room.redaction")