fix and enable collapsible_if lint

Signed-off-by: June Strawberry <june@vern.cc>
This commit is contained in:
June Strawberry
2026-01-15 17:39:33 -05:00
parent fb102f0e0a
commit 04e66a03d3
54 changed files with 453 additions and 504 deletions

View File

@@ -446,10 +446,10 @@ async fn create_create_event(
))))
})?;
if !services.config.federate_created_rooms {
if !services.config.allow_federation || !content.contains_key("m.federate") {
content.insert("m.federate".into(), json!(false).try_into()?);
}
if !services.config.federate_created_rooms
&& (!services.config.allow_federation || !content.contains_key("m.federate"))
{
content.insert("m.federate".into(), json!(false).try_into()?);
}
content.insert(
@@ -578,10 +578,10 @@ async fn create_create_event_legacy(
},
}
if !services.config.federate_created_rooms {
if !services.config.allow_federation || !content.contains_key("m.federate") {
content.insert("m.federate".into(), json!(false).try_into()?);
}
if !services.config.federate_created_rooms
&& (!services.config.allow_federation || !content.contains_key("m.federate"))
{
content.insert("m.federate".into(), json!(false).try_into()?);
}
content.insert(