If no power_level event default to 0 power_level for user
This commit is contained in:
parent
8ca1726e98
commit
acd829336e
@ -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");
|
||||
|
14
src/lib.rs
14
src/lib.rs
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user