mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-06-27 11:34:51 +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 {
|
||||
// pub server: Arc<Server>,
|
||||
pub config: Dep<config::Service>,
|
||||
pub config: Dep<config::Service>
|
||||
}
|
||||
|
||||
impl crate::Service for Service {
|
||||
fn build(args: crate::Args<'_>) -> Result<Arc<Self>> {
|
||||
Ok(Arc::new(Self {
|
||||
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!()) }
|
||||
}
|
||||
|
||||
#[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)]
|
||||
#[must_use]
|
||||
pub fn is_remote_server_forbidden(&self, server_name: &ServerName) -> bool {
|
||||
|
|
Loading…
Add table
Reference in a new issue