mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-09-11 00:12:49 +02:00
apply new rustfmt.toml changes, fix some clippy lints
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
0317cc8cc5
commit
77e0b76408
296 changed files with 7147 additions and 4300 deletions
|
@ -42,8 +42,9 @@ pub async fn create_admin_room(services: &Services) -> Result<()> {
|
|||
let create_content = {
|
||||
use RoomVersionId::*;
|
||||
match room_version {
|
||||
V1 | V2 | V3 | V4 | V5 | V6 | V7 | V8 | V9 | V10 => RoomCreateEventContent::new_v1(server_user.clone()),
|
||||
_ => RoomCreateEventContent::new_v11(),
|
||||
| V1 | V2 | V3 | V4 | V5 | V6 | V7 | V8 | V9 | V10 =>
|
||||
RoomCreateEventContent::new_v1(server_user.clone()),
|
||||
| _ => RoomCreateEventContent::new_v11(),
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -52,15 +53,12 @@ pub async fn create_admin_room(services: &Services) -> Result<()> {
|
|||
.rooms
|
||||
.timeline
|
||||
.build_and_append_pdu(
|
||||
PduBuilder::state(
|
||||
String::new(),
|
||||
&RoomCreateEventContent {
|
||||
federate: true,
|
||||
predecessor: None,
|
||||
room_version: room_version.clone(),
|
||||
..create_content
|
||||
},
|
||||
),
|
||||
PduBuilder::state(String::new(), &RoomCreateEventContent {
|
||||
federate: true,
|
||||
predecessor: None,
|
||||
room_version: room_version.clone(),
|
||||
..create_content
|
||||
}),
|
||||
server_user,
|
||||
&room_id,
|
||||
&state_lock,
|
||||
|
@ -72,7 +70,10 @@ pub async fn create_admin_room(services: &Services) -> Result<()> {
|
|||
.rooms
|
||||
.timeline
|
||||
.build_and_append_pdu(
|
||||
PduBuilder::state(server_user.to_string(), &RoomMemberEventContent::new(MembershipState::Join)),
|
||||
PduBuilder::state(
|
||||
server_user.to_string(),
|
||||
&RoomMemberEventContent::new(MembershipState::Join),
|
||||
),
|
||||
server_user,
|
||||
&room_id,
|
||||
&state_lock,
|
||||
|
@ -86,13 +87,10 @@ pub async fn create_admin_room(services: &Services) -> Result<()> {
|
|||
.rooms
|
||||
.timeline
|
||||
.build_and_append_pdu(
|
||||
PduBuilder::state(
|
||||
String::new(),
|
||||
&RoomPowerLevelsEventContent {
|
||||
users,
|
||||
..Default::default()
|
||||
},
|
||||
),
|
||||
PduBuilder::state(String::new(), &RoomPowerLevelsEventContent {
|
||||
users,
|
||||
..Default::default()
|
||||
}),
|
||||
server_user,
|
||||
&room_id,
|
||||
&state_lock,
|
||||
|
@ -131,7 +129,10 @@ pub async fn create_admin_room(services: &Services) -> Result<()> {
|
|||
.rooms
|
||||
.timeline
|
||||
.build_and_append_pdu(
|
||||
PduBuilder::state(String::new(), &RoomGuestAccessEventContent::new(GuestAccess::Forbidden)),
|
||||
PduBuilder::state(
|
||||
String::new(),
|
||||
&RoomGuestAccessEventContent::new(GuestAccess::Forbidden),
|
||||
),
|
||||
server_user,
|
||||
&room_id,
|
||||
&state_lock,
|
||||
|
@ -155,12 +156,9 @@ pub async fn create_admin_room(services: &Services) -> Result<()> {
|
|||
.rooms
|
||||
.timeline
|
||||
.build_and_append_pdu(
|
||||
PduBuilder::state(
|
||||
String::new(),
|
||||
&RoomTopicEventContent {
|
||||
topic: format!("Manage {}", services.globals.server_name()),
|
||||
},
|
||||
),
|
||||
PduBuilder::state(String::new(), &RoomTopicEventContent {
|
||||
topic: format!("Manage {}", services.globals.server_name()),
|
||||
}),
|
||||
server_user,
|
||||
&room_id,
|
||||
&state_lock,
|
||||
|
@ -174,13 +172,10 @@ pub async fn create_admin_room(services: &Services) -> Result<()> {
|
|||
.rooms
|
||||
.timeline
|
||||
.build_and_append_pdu(
|
||||
PduBuilder::state(
|
||||
String::new(),
|
||||
&RoomCanonicalAliasEventContent {
|
||||
alias: Some(alias.clone()),
|
||||
alt_aliases: Vec::new(),
|
||||
},
|
||||
),
|
||||
PduBuilder::state(String::new(), &RoomCanonicalAliasEventContent {
|
||||
alias: Some(alias.clone()),
|
||||
alt_aliases: Vec::new(),
|
||||
}),
|
||||
server_user,
|
||||
&room_id,
|
||||
&state_lock,
|
||||
|
@ -197,12 +192,7 @@ pub async fn create_admin_room(services: &Services) -> Result<()> {
|
|||
.rooms
|
||||
.timeline
|
||||
.build_and_append_pdu(
|
||||
PduBuilder::state(
|
||||
String::new(),
|
||||
&RoomPreviewUrlsEventContent {
|
||||
disabled: true,
|
||||
},
|
||||
),
|
||||
PduBuilder::state(String::new(), &RoomPreviewUrlsEventContent { disabled: true }),
|
||||
server_user,
|
||||
&room_id,
|
||||
&state_lock,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue