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:
parent
83376d8ed4
commit
1c5343be79
1 changed files with 8 additions and 2 deletions
|
@ -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
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue