mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
fix: Accept_may_join callback works again
This commit is contained in:
Generated
+13
-13
@@ -1635,7 +1635,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "draupnir-antispam"
|
name = "draupnir-antispam"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=46e31bd6439eccbd3a1762f710c17fc15168c15e#46e31bd6439eccbd3a1762f710c17fc15168c15e"
|
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=42f13b1e806f3b6b04fb4d2247c73c7a565d3de1#42f13b1e806f3b6b04fb4d2247c73c7a565d3de1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ruma-common",
|
"ruma-common",
|
||||||
"serde",
|
"serde",
|
||||||
@@ -2995,7 +2995,7 @@ checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273"
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "meowlnir-antispam"
|
name = "meowlnir-antispam"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=46e31bd6439eccbd3a1762f710c17fc15168c15e#46e31bd6439eccbd3a1762f710c17fc15168c15e"
|
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=42f13b1e806f3b6b04fb4d2247c73c7a565d3de1#42f13b1e806f3b6b04fb4d2247c73c7a565d3de1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ruma-common",
|
"ruma-common",
|
||||||
"serde",
|
"serde",
|
||||||
@@ -4085,7 +4085,7 @@ checksum = "88f8660c1ff60292143c98d08fc6e2f654d722db50410e3f3797d40baaf9d8f3"
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma"
|
name = "ruma"
|
||||||
version = "0.10.1"
|
version = "0.10.1"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=46e31bd6439eccbd3a1762f710c17fc15168c15e#46e31bd6439eccbd3a1762f710c17fc15168c15e"
|
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=42f13b1e806f3b6b04fb4d2247c73c7a565d3de1#42f13b1e806f3b6b04fb4d2247c73c7a565d3de1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"assign",
|
"assign",
|
||||||
"draupnir-antispam",
|
"draupnir-antispam",
|
||||||
@@ -4107,7 +4107,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-appservice-api"
|
name = "ruma-appservice-api"
|
||||||
version = "0.10.0"
|
version = "0.10.0"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=46e31bd6439eccbd3a1762f710c17fc15168c15e#46e31bd6439eccbd3a1762f710c17fc15168c15e"
|
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=42f13b1e806f3b6b04fb4d2247c73c7a565d3de1#42f13b1e806f3b6b04fb4d2247c73c7a565d3de1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"js_int",
|
"js_int",
|
||||||
"ruma-common",
|
"ruma-common",
|
||||||
@@ -4119,7 +4119,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-client-api"
|
name = "ruma-client-api"
|
||||||
version = "0.18.0"
|
version = "0.18.0"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=46e31bd6439eccbd3a1762f710c17fc15168c15e#46e31bd6439eccbd3a1762f710c17fc15168c15e"
|
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=42f13b1e806f3b6b04fb4d2247c73c7a565d3de1#42f13b1e806f3b6b04fb4d2247c73c7a565d3de1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"as_variant",
|
"as_variant",
|
||||||
"assign",
|
"assign",
|
||||||
@@ -4142,7 +4142,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-common"
|
name = "ruma-common"
|
||||||
version = "0.13.0"
|
version = "0.13.0"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=46e31bd6439eccbd3a1762f710c17fc15168c15e#46e31bd6439eccbd3a1762f710c17fc15168c15e"
|
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=42f13b1e806f3b6b04fb4d2247c73c7a565d3de1#42f13b1e806f3b6b04fb4d2247c73c7a565d3de1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"as_variant",
|
"as_variant",
|
||||||
"base64 0.22.1",
|
"base64 0.22.1",
|
||||||
@@ -4174,7 +4174,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-events"
|
name = "ruma-events"
|
||||||
version = "0.28.1"
|
version = "0.28.1"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=46e31bd6439eccbd3a1762f710c17fc15168c15e#46e31bd6439eccbd3a1762f710c17fc15168c15e"
|
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=42f13b1e806f3b6b04fb4d2247c73c7a565d3de1#42f13b1e806f3b6b04fb4d2247c73c7a565d3de1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"as_variant",
|
"as_variant",
|
||||||
"indexmap",
|
"indexmap",
|
||||||
@@ -4199,7 +4199,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-federation-api"
|
name = "ruma-federation-api"
|
||||||
version = "0.9.0"
|
version = "0.9.0"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=46e31bd6439eccbd3a1762f710c17fc15168c15e#46e31bd6439eccbd3a1762f710c17fc15168c15e"
|
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=42f13b1e806f3b6b04fb4d2247c73c7a565d3de1#42f13b1e806f3b6b04fb4d2247c73c7a565d3de1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"headers",
|
"headers",
|
||||||
@@ -4221,7 +4221,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-identifiers-validation"
|
name = "ruma-identifiers-validation"
|
||||||
version = "0.9.5"
|
version = "0.9.5"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=46e31bd6439eccbd3a1762f710c17fc15168c15e#46e31bd6439eccbd3a1762f710c17fc15168c15e"
|
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=42f13b1e806f3b6b04fb4d2247c73c7a565d3de1#42f13b1e806f3b6b04fb4d2247c73c7a565d3de1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"js_int",
|
"js_int",
|
||||||
"thiserror 2.0.17",
|
"thiserror 2.0.17",
|
||||||
@@ -4230,7 +4230,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-identity-service-api"
|
name = "ruma-identity-service-api"
|
||||||
version = "0.9.0"
|
version = "0.9.0"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=46e31bd6439eccbd3a1762f710c17fc15168c15e#46e31bd6439eccbd3a1762f710c17fc15168c15e"
|
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=42f13b1e806f3b6b04fb4d2247c73c7a565d3de1#42f13b1e806f3b6b04fb4d2247c73c7a565d3de1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"js_int",
|
"js_int",
|
||||||
"ruma-common",
|
"ruma-common",
|
||||||
@@ -4240,7 +4240,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-macros"
|
name = "ruma-macros"
|
||||||
version = "0.13.0"
|
version = "0.13.0"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=46e31bd6439eccbd3a1762f710c17fc15168c15e#46e31bd6439eccbd3a1762f710c17fc15168c15e"
|
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=42f13b1e806f3b6b04fb4d2247c73c7a565d3de1#42f13b1e806f3b6b04fb4d2247c73c7a565d3de1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"proc-macro-crate",
|
"proc-macro-crate",
|
||||||
@@ -4255,7 +4255,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-push-gateway-api"
|
name = "ruma-push-gateway-api"
|
||||||
version = "0.9.0"
|
version = "0.9.0"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=46e31bd6439eccbd3a1762f710c17fc15168c15e#46e31bd6439eccbd3a1762f710c17fc15168c15e"
|
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=42f13b1e806f3b6b04fb4d2247c73c7a565d3de1#42f13b1e806f3b6b04fb4d2247c73c7a565d3de1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"js_int",
|
"js_int",
|
||||||
"ruma-common",
|
"ruma-common",
|
||||||
@@ -4267,7 +4267,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-signatures"
|
name = "ruma-signatures"
|
||||||
version = "0.15.0"
|
version = "0.15.0"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=46e31bd6439eccbd3a1762f710c17fc15168c15e#46e31bd6439eccbd3a1762f710c17fc15168c15e"
|
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=42f13b1e806f3b6b04fb4d2247c73c7a565d3de1#42f13b1e806f3b6b04fb4d2247c73c7a565d3de1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64 0.22.1",
|
"base64 0.22.1",
|
||||||
"ed25519-dalek",
|
"ed25519-dalek",
|
||||||
|
|||||||
+1
-1
@@ -351,7 +351,7 @@ version = "0.1.2"
|
|||||||
# Used for matrix spec type definitions and helpers
|
# Used for matrix spec type definitions and helpers
|
||||||
[workspace.dependencies.ruma]
|
[workspace.dependencies.ruma]
|
||||||
git = "https://forgejo.ellis.link/continuwuation/ruwuma"
|
git = "https://forgejo.ellis.link/continuwuation/ruwuma"
|
||||||
rev = "46e31bd6439eccbd3a1762f710c17fc15168c15e"
|
rev = "42f13b1e806f3b6b04fb4d2247c73c7a565d3de1"
|
||||||
features = [
|
features = [
|
||||||
"compat",
|
"compat",
|
||||||
"rand",
|
"rand",
|
||||||
|
|||||||
@@ -207,23 +207,15 @@ pub(crate) async fn user_can_perform_restricted_join(
|
|||||||
return Ok(true);
|
return Ok(true);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
| AllowRule::UnstableSpamChecker => {
|
| AllowRule::UnstableSpamChecker =>
|
||||||
match services
|
return match services
|
||||||
.antispam
|
.antispam
|
||||||
.meowlnir_accept_make_join(room_id.to_owned(), user_id.to_owned())
|
.meowlnir_accept_make_join(room_id.to_owned(), user_id.to_owned())
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
| Ok(()) => {
|
| Ok(()) => Ok(true),
|
||||||
return Ok(true);
|
| Err(e) => Err!(Request(Forbidden("Antispam rejected join request."))),
|
||||||
},
|
},
|
||||||
| Err(e) => {
|
|
||||||
info!(
|
|
||||||
"meowlnir rejected restricted join for user {} into room {}: {e:?}",
|
|
||||||
user_id, room_id
|
|
||||||
);
|
|
||||||
},
|
|
||||||
}
|
|
||||||
},
|
|
||||||
| _ => {
|
| _ => {
|
||||||
debug_info!(
|
debug_info!(
|
||||||
"Unsupported allow rule in restricted join for room {}: {:?}",
|
"Unsupported allow rule in restricted join for room {}: {:?}",
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
use std::sync::Arc;
|
use std::{fmt::Debug, sync::Arc};
|
||||||
|
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use conduwuit::{Result, config::Antispam, debug};
|
use conduwuit::{Result, config::Antispam, debug};
|
||||||
@@ -37,7 +37,7 @@ impl Service {
|
|||||||
request: T,
|
request: T,
|
||||||
) -> Result<T::IncomingResponse>
|
) -> Result<T::IncomingResponse>
|
||||||
where
|
where
|
||||||
T: ruma::api::OutgoingRequest + std::fmt::Debug + Send,
|
T: ruma::api::OutgoingRequest + Debug + Send,
|
||||||
{
|
{
|
||||||
sending::antispam::send_antispam_request(
|
sending::antispam::send_antispam_request(
|
||||||
&self.services.client.appservice,
|
&self.services.client.appservice,
|
||||||
@@ -62,7 +62,7 @@ impl Service {
|
|||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
if let Some(config) = &self.services.config.antispam {
|
if let Some(config) = &self.services.config.antispam {
|
||||||
let result = if let Some(meowlnir) = &config.meowlnir {
|
let result = if let Some(meowlnir) = &config.meowlnir {
|
||||||
debug!("Asking meowlnir for user_may_invite");
|
debug!(?room_id, ?inviter, ?invitee, "Asking meowlnir for user_may_invite");
|
||||||
self.send_antispam_request(
|
self.send_antispam_request(
|
||||||
meowlnir.base_url.as_str(),
|
meowlnir.base_url.as_str(),
|
||||||
&meowlnir.secret,
|
&meowlnir.secret,
|
||||||
@@ -78,7 +78,7 @@ impl Service {
|
|||||||
.inspect_err(|e| debug!("meowlnir denied the invite: {e:?}"))
|
.inspect_err(|e| debug!("meowlnir denied the invite: {e:?}"))
|
||||||
.map(|_| ())
|
.map(|_| ())
|
||||||
} else if let Some(draupnir) = &config.draupnir {
|
} else if let Some(draupnir) = &config.draupnir {
|
||||||
debug!("Asking draupnir for user_may_invite");
|
debug!(?room_id, ?inviter, ?invitee, "Asking draupnir for user_may_invite");
|
||||||
self.send_antispam_request(
|
self.send_antispam_request(
|
||||||
draupnir.base_url.as_str(),
|
draupnir.base_url.as_str(),
|
||||||
&draupnir.secret,
|
&draupnir.secret,
|
||||||
@@ -107,7 +107,7 @@ impl Service {
|
|||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
if let Some(config) = &self.services.config.antispam {
|
if let Some(config) = &self.services.config.antispam {
|
||||||
let result = if let Some(meowlnir) = &config.meowlnir {
|
let result = if let Some(meowlnir) = &config.meowlnir {
|
||||||
debug!("Asking meowlnir for user_may_join_room");
|
debug!(?room_id, ?user_id, ?is_invited, "Asking meowlnir for user_may_join_room");
|
||||||
self.send_antispam_request(
|
self.send_antispam_request(
|
||||||
meowlnir.base_url.as_str(),
|
meowlnir.base_url.as_str(),
|
||||||
&meowlnir.secret,
|
&meowlnir.secret,
|
||||||
@@ -123,7 +123,7 @@ impl Service {
|
|||||||
.inspect_err(|e| debug!("meowlnir denied the join: {e:?}"))
|
.inspect_err(|e| debug!("meowlnir denied the join: {e:?}"))
|
||||||
.map(|_| ())
|
.map(|_| ())
|
||||||
} else if let Some(draupnir) = &config.draupnir {
|
} else if let Some(draupnir) = &config.draupnir {
|
||||||
debug!("Asking draupnir for user_may_join_room");
|
debug!(?room_id, ?user_id, ?is_invited, "Asking draupnir for user_may_join_room");
|
||||||
self.send_antispam_request(
|
self.send_antispam_request(
|
||||||
draupnir.base_url.as_str(),
|
draupnir.base_url.as_str(),
|
||||||
&draupnir.secret,
|
&draupnir.secret,
|
||||||
@@ -151,7 +151,7 @@ impl Service {
|
|||||||
user_id: OwnedUserId,
|
user_id: OwnedUserId,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
if let Some(Antispam { meowlnir: Some(meowlnir), .. }) = &self.services.config.antispam {
|
if let Some(Antispam { meowlnir: Some(meowlnir), .. }) = &self.services.config.antispam {
|
||||||
debug!("Asking meowlnir for meowlnir_accept_make_join");
|
debug!(?room_id, ?user_id, "Asking meowlnir for accept_make_join");
|
||||||
self.send_antispam_request(
|
self.send_antispam_request(
|
||||||
meowlnir.base_url.as_str(),
|
meowlnir.base_url.as_str(),
|
||||||
&meowlnir.secret,
|
&meowlnir.secret,
|
||||||
|
|||||||
Reference in New Issue
Block a user