If no power_level event default to 0 power_level for user

This commit is contained in:
Devin Ragotzy 2020-09-08 16:59:29 -04:00
parent 8ca1726e98
commit acd829336e
2 changed files with 4 additions and 18 deletions

View File

@ -263,10 +263,10 @@ pub fn auth_check(
tracing::info!("power levels event allowed");
}
if incoming_event.kind() == EventType::RoomRedaction {
if !check_redaction(room_version, incoming_event, &auth_events)? {
return Ok(false);
}
if incoming_event.kind() == EventType::RoomRedaction
&& !check_redaction(room_version, incoming_event, &auth_events)?
{
return Ok(false);
}
tracing::info!("allowing event passed all checks");

View File

@ -438,20 +438,6 @@ impl StateResolution {
}
if pl.is_none() {
for aid in store.get_event(room_id, event_id).unwrap().auth_events() {
if let Ok(aev) = store.get_event(room_id, &aid) {
if aev.is_type_and_key(EventType::RoomCreate, "") {
if let Ok(content) = aev
.deserialize_content::<ruma::events::room::create::CreateEventContent>()
{
if &content.creator == aev.sender() {
return 100;
}
break;
}
}
}
}
return 0;
}