0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-25 08:12:37 +01:00

modules/m_room_power_levels: Minor upgrade to c++17 syntax.

This commit is contained in:
Jason Volk 2019-08-07 01:11:45 -07:00
parent b4ba03ae15
commit bfe1eace7d

View file

@ -74,15 +74,15 @@ ircd::m::auth_room_power_levels(const m::event &event,
"m.room.power_levels content.users is not a json object." "m.room.power_levels content.users is not a json object."
}; };
for(const auto &member : json::object(at<"content"_>(event).at("users"))) for(const auto &[user_id, value] : json::object(at<"content"_>(event).at("users")))
{ {
if(!m::valid(m::id::USER, member.first)) if(!m::valid(m::id::USER, user_id))
throw FAIL throw FAIL
{ {
"m.room.power_levels content.users key is not a user mxid" "m.room.power_levels content.users key is not a user mxid"
}; };
if(!try_lex_cast<int64_t>(unquote(member.second))) if(!try_lex_cast<int64_t>(unquote(value)))
throw FAIL throw FAIL
{ {
"m.room.power_levels content.users value is not an integer." "m.room.power_levels content.users value is not an integer."