mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-07-01 20:25:46 +02:00
Run cargo fmt
Some checks failed
Checks / Prefligit / prefligit (push) Failing after 4s
Release Docker Image / define-variables (push) Failing after 12s
Release Docker Image / build-image (linux/amd64, release, linux-amd64, base) (push) Has been skipped
Release Docker Image / build-image (linux/arm64, release, linux-arm64, base) (push) Has been skipped
Release Docker Image / merge (push) Has been skipped
Checks / Rust / Format (push) Failing after 8s
Checks / Rust / Clippy (push) Failing after 14s
Checks / Rust / Cargo Test (push) Failing after 11s
Some checks failed
Checks / Prefligit / prefligit (push) Failing after 4s
Release Docker Image / define-variables (push) Failing after 12s
Release Docker Image / build-image (linux/amd64, release, linux-amd64, base) (push) Has been skipped
Release Docker Image / build-image (linux/arm64, release, linux-arm64, base) (push) Has been skipped
Release Docker Image / merge (push) Has been skipped
Checks / Rust / Format (push) Failing after 8s
Checks / Rust / Clippy (push) Failing after 14s
Checks / Rust / Cargo Test (push) Failing after 11s
This commit is contained in:
parent
b243069c6f
commit
5ec8e378c2
1 changed files with 7 additions and 7 deletions
|
@ -4,10 +4,9 @@ use conduwuit::{
|
||||||
use ruma::{
|
use ruma::{
|
||||||
RoomId, ServerName,
|
RoomId, ServerName,
|
||||||
api::federation::room::policy::v1::Request as PolicyRequest,
|
api::federation::room::policy::v1::Request as PolicyRequest,
|
||||||
events::StateEventType,
|
canonical_json::to_canonical_value,
|
||||||
events::room::policy::RoomPolicyEventContent,
|
events::{StateEventType, room::policy::RoomPolicyEventContent},
|
||||||
};
|
};
|
||||||
use ruma::canonical_json::to_canonical_value;
|
|
||||||
|
|
||||||
/// Returns Ok if the policy server allows the event
|
/// Returns Ok if the policy server allows the event
|
||||||
#[implement(super::Service)]
|
#[implement(super::Service)]
|
||||||
|
@ -32,16 +31,17 @@ pub async fn policyserv_check(&self, pdu: &PduEvent, room_id: &RoomId) -> Result
|
||||||
};
|
};
|
||||||
// TODO: dont do *this*
|
// TODO: dont do *this*
|
||||||
let pdu_json = self.services.timeline.get_pdu_json(pdu.event_id()).await?;
|
let pdu_json = self.services.timeline.get_pdu_json(pdu.event_id()).await?;
|
||||||
let outgoing = self.services
|
let outgoing = self
|
||||||
|
.services
|
||||||
.sending
|
.sending
|
||||||
.convert_to_outgoing_federation_event(pdu_json)
|
.convert_to_outgoing_federation_event(pdu_json)
|
||||||
.await;
|
.await;
|
||||||
// let s = match serde_json::to_string(outgoing.as_ref()) {
|
// let s = match serde_json::to_string(outgoing.as_ref()) {
|
||||||
// | Ok(s) => s,
|
// | Ok(s) => s,
|
||||||
// | Err(e) => {
|
// | Err(e) => {
|
||||||
// warn!("Failed to convert pdu {} to outgoing federation event: {e}", pdu.event_id());
|
// warn!("Failed to convert pdu {} to outgoing federation event: {e}",
|
||||||
// return Err!(Request(InvalidParam("Failed to convert PDU to outgoing event.")));
|
// pdu.event_id()); return Err!(Request(InvalidParam("Failed to convert PDU
|
||||||
// },
|
// to outgoing event."))); },
|
||||||
// };
|
// };
|
||||||
debug!("Checking pdu {outgoing:?} for spam with policy server {via} for room {room_id}");
|
debug!("Checking pdu {outgoing:?} for spam with policy server {via} for room {room_id}");
|
||||||
let response = self
|
let response = self
|
||||||
|
|
Loading…
Add table
Reference in a new issue