mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-19 00:31:24 +01:00
fix lints for upcoming 1.88.0 toolchain
This commit is contained in:
parent
fa6fb37a2c
commit
595f35b673
19 changed files with 41 additions and 42 deletions
|
|
@ -246,7 +246,7 @@ impl TracingFilterCommand {
|
|||
#[derive(Debug)]
|
||||
pub(crate) enum AdminRoomEvent {
|
||||
ProcessMessage(String),
|
||||
SendMessage(RoomMessageEventContent),
|
||||
SendMessage(Box<RoomMessageEventContent>),
|
||||
}
|
||||
|
||||
pub(crate) struct Service {
|
||||
|
|
@ -297,7 +297,7 @@ impl Service {
|
|||
grapevine_room: &OwnedRoomId,
|
||||
) {
|
||||
let message_content = match event {
|
||||
AdminRoomEvent::SendMessage(content) => content,
|
||||
AdminRoomEvent::SendMessage(content) => *content,
|
||||
AdminRoomEvent::ProcessMessage(room_message) => {
|
||||
self.process_admin_message(room_message).await
|
||||
}
|
||||
|
|
@ -343,7 +343,9 @@ impl Service {
|
|||
&self,
|
||||
message_content: RoomMessageEventContent,
|
||||
) {
|
||||
self.sender.send(AdminRoomEvent::SendMessage(message_content)).unwrap();
|
||||
self.sender
|
||||
.send(AdminRoomEvent::SendMessage(Box::new(message_content)))
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
// Parse and process a message from the admin room
|
||||
|
|
@ -701,7 +703,7 @@ impl Service {
|
|||
return Ok(RoomMessageEventContent::text_plain(
|
||||
"The specified user is not from this server!",
|
||||
));
|
||||
};
|
||||
}
|
||||
|
||||
// Check if the specified user is valid
|
||||
if !services().users.exists(&user_id)?
|
||||
|
|
@ -1234,7 +1236,7 @@ impl Service {
|
|||
return Ok(RoomMessageEventContent::text_plain(format!(
|
||||
"Failed to reload filter: {e}"
|
||||
)));
|
||||
};
|
||||
}
|
||||
|
||||
return Ok(RoomMessageEventContent::text_plain(
|
||||
"Filter reloaded",
|
||||
|
|
|
|||
|
|
@ -329,7 +329,7 @@ impl Service {
|
|||
error!(config=?s.config.default_room_version, fallback=?crate::config::default_default_room_version(), "Room version in config isn't supported, falling back to default version");
|
||||
s.config.default_room_version =
|
||||
crate::config::default_default_room_version();
|
||||
};
|
||||
}
|
||||
|
||||
Ok(s)
|
||||
}
|
||||
|
|
@ -526,7 +526,7 @@ impl Service {
|
|||
Grapevine user",
|
||||
);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn supported_room_versions(&self) -> Vec<RoomVersionId> {
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ impl Service {
|
|||
if i % 100 == 0 {
|
||||
tokio::task::yield_now().await;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
debug!(
|
||||
chunk_cache_length = ?chunk_cache.len(),
|
||||
|
|
|
|||
|
|
@ -1126,10 +1126,7 @@ impl Service {
|
|||
services()
|
||||
.rooms
|
||||
.auth_chain
|
||||
.get_auth_chain(
|
||||
room_id,
|
||||
state.iter().map(|(_, id)| id.clone()).collect(),
|
||||
)
|
||||
.get_auth_chain(room_id, state.values().cloned().collect())
|
||||
.await?
|
||||
.collect(),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ impl Service {
|
|||
.invalidate_cache(&pdu.room_id)
|
||||
.await;
|
||||
}
|
||||
_ => continue,
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@ impl Service {
|
|||
)?;
|
||||
|
||||
return Ok(());
|
||||
};
|
||||
}
|
||||
|
||||
// Else we have two options.
|
||||
// 1. We add the current diff on top of the parent layer.
|
||||
|
|
@ -374,7 +374,7 @@ impl Service {
|
|||
2,
|
||||
states_parents,
|
||||
)?;
|
||||
};
|
||||
}
|
||||
|
||||
Ok((new_shortstatehash, statediffnew, statediffremoved))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -442,7 +442,7 @@ impl Service {
|
|||
highlight = true;
|
||||
}
|
||||
_ => {}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
if notify {
|
||||
|
|
@ -497,7 +497,7 @@ impl Service {
|
|||
)? {
|
||||
self.redact_pdu(redact_id, pdu, shortroomid)?;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
TimelineEventType::SpaceChild => {
|
||||
if pdu.state_key.is_some() {
|
||||
|
|
|
|||
|
|
@ -96,12 +96,12 @@ impl Service {
|
|||
if let Some(cached_list) = cached.lists.get(list_id) {
|
||||
if list.sort.is_empty() {
|
||||
list.sort.clone_from(&cached_list.sort);
|
||||
};
|
||||
}
|
||||
if list.room_details.required_state.is_empty() {
|
||||
list.room_details
|
||||
.required_state
|
||||
.clone_from(&cached_list.room_details.required_state);
|
||||
};
|
||||
}
|
||||
list.room_details.timeline_limit = list
|
||||
.room_details
|
||||
.timeline_limit
|
||||
|
|
@ -151,7 +151,7 @@ impl Service {
|
|||
if list.bump_event_types.is_empty() {
|
||||
list.bump_event_types
|
||||
.clone_from(&cached_list.bump_event_types);
|
||||
};
|
||||
}
|
||||
}
|
||||
cached.lists.insert(list_id.clone(), list.clone());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue