0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 07:23:53 +01:00

modules/m_room_power_levels: Ignore invalid user mxids in array.

This commit is contained in:
Jason Volk 2019-09-09 19:52:15 -07:00
parent 83376d8ed4
commit 1c5343be79

View file

@ -77,11 +77,17 @@ ircd::m::auth_room_power_levels(const m::event &event,
for(const auto &[user_id, value] : 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, user_id)) if(!m::valid(m::id::USER, user_id))
throw FAIL {
log::dwarning
{ {
"m.room.power_levels content.users key is not a user mxid" m::log, "Power levels in %s 'users' invalid entry '%s'; not user mxid.",
string_view{event.event_id},
user_id,
}; };
continue;
}
if(!try_lex_cast<int64_t>(unquote(value))) if(!try_lex_cast<int64_t>(unquote(value)))
throw FAIL throw FAIL
{ {