mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-09-12 10:22:58 +02:00
Compare commits
8 commits
5454c22b5b
...
5ebe8cd8dd
Author | SHA1 | Date | |
---|---|---|---|
|
5ebe8cd8dd |
||
|
d4049a79bf |
||
|
1bc06fcd57 |
||
|
cff4076fad |
||
|
dded3a2981 |
||
|
ca263af321 |
||
|
19a8eaca39 |
||
|
ce94e241b3 |
4 changed files with 2 additions and 30 deletions
16
.typos.toml
16
.typos.toml
|
@ -1,19 +1,5 @@
|
||||||
[files]
|
[files]
|
||||||
extend-exclude = ["*.csr", "*.lock", "pnpm-lock.yaml"]
|
extend-exclude = ["*.csr"]
|
||||||
|
|
||||||
[default]
|
|
||||||
|
|
||||||
extend-ignore-re = [
|
|
||||||
"(?Rm)^.*(#|//|<!--)\\s*spellchecker:disable-line(\\s*-->)$", # Ignore a line by making it trail with a `spellchecker:disable-line` comment
|
|
||||||
"^[0-9a-f]{7,}$", # Commit hashes
|
|
||||||
|
|
||||||
# some heuristics for base64 strings
|
|
||||||
"[A-Za-z0-9+=]{72,}",
|
|
||||||
"([A-Za-z0-9+=]|\\\\\\s\\*){72,}",
|
|
||||||
"[0-9+][A-Za-z0-9+]{30,}[a-z0-9+]",
|
|
||||||
"\\$[A-Z0-9+][A-Za-z0-9+]{6,}[a-z0-9+]",
|
|
||||||
"\\b[a-z0-9+/=][A-Za-z0-9+/=]{7,}[a-z0-9+/=][A-Z]\\b",
|
|
||||||
]
|
|
||||||
|
|
||||||
[default.extend-words]
|
[default.extend-words]
|
||||||
"allocatedp" = "allocatedp"
|
"allocatedp" = "allocatedp"
|
||||||
|
|
|
@ -11,10 +11,6 @@ use ruma::{
|
||||||
#[implement(super::Service)]
|
#[implement(super::Service)]
|
||||||
#[tracing::instrument(skip_all, level = "debug")]
|
#[tracing::instrument(skip_all, level = "debug")]
|
||||||
pub async fn policyserv_check(&self, pdu: &PduEvent, room_id: &RoomId) -> Result {
|
pub async fn policyserv_check(&self, pdu: &PduEvent, room_id: &RoomId) -> Result {
|
||||||
if *pdu.event_type() == StateEventType::RoomPolicy.into() {
|
|
||||||
debug!("Skipping spam check for policy server meta-event in room {room_id}");
|
|
||||||
return Ok(());
|
|
||||||
}
|
|
||||||
let Ok(policyserver) = self
|
let Ok(policyserver) = self
|
||||||
.services
|
.services
|
||||||
.state_accessor
|
.state_accessor
|
||||||
|
@ -32,14 +28,6 @@ pub async fn policyserv_check(&self, pdu: &PduEvent, room_id: &RoomId) -> Result
|
||||||
return Ok(());
|
return Ok(());
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
if via.is_empty() {
|
|
||||||
debug!("Policy server is empty for room {room_id}, skipping spam check");
|
|
||||||
return Ok(());
|
|
||||||
}
|
|
||||||
if !self.services.state_cache.server_in_room(via, room_id).await {
|
|
||||||
debug!("Policy server {via} is not in the room {room_id}, skipping spam check");
|
|
||||||
return Ok(());
|
|
||||||
}
|
|
||||||
let outgoing = self
|
let outgoing = self
|
||||||
.services
|
.services
|
||||||
.sending
|
.sending
|
||||||
|
|
|
@ -43,7 +43,6 @@ struct Services {
|
||||||
server_keys: Dep<server_keys::Service>,
|
server_keys: Dep<server_keys::Service>,
|
||||||
short: Dep<rooms::short::Service>,
|
short: Dep<rooms::short::Service>,
|
||||||
state: Dep<rooms::state::Service>,
|
state: Dep<rooms::state::Service>,
|
||||||
state_cache: Dep<rooms::state_cache::Service>,
|
|
||||||
state_accessor: Dep<rooms::state_accessor::Service>,
|
state_accessor: Dep<rooms::state_accessor::Service>,
|
||||||
state_compressor: Dep<rooms::state_compressor::Service>,
|
state_compressor: Dep<rooms::state_compressor::Service>,
|
||||||
timeline: Dep<rooms::timeline::Service>,
|
timeline: Dep<rooms::timeline::Service>,
|
||||||
|
@ -69,7 +68,6 @@ impl crate::Service for Service {
|
||||||
pdu_metadata: args.depend::<rooms::pdu_metadata::Service>("rooms::pdu_metadata"),
|
pdu_metadata: args.depend::<rooms::pdu_metadata::Service>("rooms::pdu_metadata"),
|
||||||
short: args.depend::<rooms::short::Service>("rooms::short"),
|
short: args.depend::<rooms::short::Service>("rooms::short"),
|
||||||
state: args.depend::<rooms::state::Service>("rooms::state"),
|
state: args.depend::<rooms::state::Service>("rooms::state"),
|
||||||
state_cache: args.depend::<rooms::state_cache::Service>("rooms::state_cache"),
|
|
||||||
state_accessor: args
|
state_accessor: args
|
||||||
.depend::<rooms::state_accessor::Service>("rooms::state_accessor"),
|
.depend::<rooms::state_accessor::Service>("rooms::state_accessor"),
|
||||||
state_compressor: args
|
state_compressor: args
|
||||||
|
|
|
@ -55,7 +55,7 @@ where
|
||||||
// backwards extremities doing all the checks in this list starting at 1.
|
// backwards extremities doing all the checks in this list starting at 1.
|
||||||
// These are not timeline events.
|
// These are not timeline events.
|
||||||
|
|
||||||
debug!("Resolving state at event {}", incoming_pdu.event_id);
|
debug!("Resolving state at event");
|
||||||
let mut state_at_incoming_event = if incoming_pdu.prev_events().count() == 1 {
|
let mut state_at_incoming_event = if incoming_pdu.prev_events().count() == 1 {
|
||||||
self.state_at_incoming_degree_one(&incoming_pdu).await?
|
self.state_at_incoming_degree_one(&incoming_pdu).await?
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue