mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-06-27 22:14:50 +02:00
completely strike knowledge of the server from the moderation service
This commit is contained in:
parent
61a7b4cfbf
commit
475d66e1ea
1 changed files with 2 additions and 18 deletions
|
@ -10,16 +10,14 @@ pub struct Service {
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Services {
|
struct Services {
|
||||||
// pub server: Arc<Server>,
|
pub config: Dep<config::Service>
|
||||||
pub config: Dep<config::Service>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl crate::Service for Service {
|
impl crate::Service for Service {
|
||||||
fn build(args: crate::Args<'_>) -> Result<Arc<Self>> {
|
fn build(args: crate::Args<'_>) -> Result<Arc<Self>> {
|
||||||
Ok(Arc::new(Self {
|
Ok(Arc::new(Self {
|
||||||
services: Services {
|
services: Services {
|
||||||
// server: args.server.clone(),
|
config: args.depend::<config::Service>("config")
|
||||||
config: args.depend::<config::Service>("config"),
|
|
||||||
},
|
},
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
@ -27,20 +25,6 @@ impl crate::Service for Service {
|
||||||
fn name(&self) -> &str { crate::service::make_name(std::module_path!()) }
|
fn name(&self) -> &str { crate::service::make_name(std::module_path!()) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[implement(Service)]
|
|
||||||
#[must_use]
|
|
||||||
pub fn is_remote_server_ignored(&self, server_name: &ServerName) -> bool {
|
|
||||||
// We must never block federating with ourselves
|
|
||||||
if server_name == self.services.config.server_name {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
self.services
|
|
||||||
.config
|
|
||||||
.ignore_messages_from_server_names
|
|
||||||
.is_match(server_name.host())
|
|
||||||
}
|
|
||||||
|
|
||||||
#[implement(Service)]
|
#[implement(Service)]
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn is_remote_server_forbidden(&self, server_name: &ServerName) -> bool {
|
pub fn is_remote_server_forbidden(&self, server_name: &ServerName) -> bool {
|
||||||
|
|
Loading…
Add table
Reference in a new issue