mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bc79c84f65 | |||
| 60dd6baffd | |||
| 99a10998b4 | |||
| 05c6b5df75 |
@@ -13,8 +13,8 @@ OCI images for Continuwuity are available in the registries listed below.
|
||||
| --------------- | --------------------------------------------------------------- | -----------------------|
|
||||
| Forgejo Registry| [forgejo.ellis.link/continuwuation/continuwuity:latest](https://forgejo.ellis.link/continuwuation/-/packages/container/continuwuity/latest) | Latest tagged image. |
|
||||
| Forgejo Registry| [forgejo.ellis.link/continuwuation/continuwuity:main](https://forgejo.ellis.link/continuwuation/-/packages/container/continuwuity/main) | Main branch image. |
|
||||
| Forgejo Registry| [forgejo.ellis.link/continuwuation/continuwuity:latest-maxperf](https://forgejo.ellis.link/continuwuation/-/packages/container/continuwuity/latest-maxperf) | Performance optimised version. |
|
||||
| Forgejo Registry| [forgejo.ellis.link/continuwuation/continuwuity:main-maxperf](https://forgejo.ellis.link/continuwuation/-/packages/container/continuwuity/main-maxperf) | Performance optimised version. |
|
||||
| Forgejo Registry| [forgejo.ellis.link/continuwuation/continuwuity:latest-maxperf](https://forgejo.ellis.link/continuwuation/-/packages/container/continuwuity/latest-maxperf) | [Performance optimised version.](./generic.mdx#performance-optimised-builds) |
|
||||
| Forgejo Registry| [forgejo.ellis.link/continuwuation/continuwuity:main-maxperf](https://forgejo.ellis.link/continuwuation/-/packages/container/continuwuity/main-maxperf) | [Performance optimised version.](./generic.mdx#performance-optimised-builds) |
|
||||
|
||||
Use
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ use conduwuit::{
|
||||
};
|
||||
use futures::FutureExt;
|
||||
use ruma::{
|
||||
OwnedServerName, RoomId, UserId,
|
||||
RoomId, UserId,
|
||||
api::{client::membership::invite_user, federation::membership::create_invite},
|
||||
events::{
|
||||
invite_permission_config::FilterLevel,
|
||||
@@ -203,19 +203,10 @@ pub(crate) async fn invite_helper(
|
||||
))));
|
||||
}
|
||||
|
||||
let origin: OwnedServerName = serde_json::from_value(serde_json::to_value(
|
||||
value
|
||||
.get("origin")
|
||||
.ok_or_else(|| err!(Request(BadJson("Event missing origin field."))))?,
|
||||
)?)
|
||||
.map_err(|e| {
|
||||
err!(Request(BadJson(warn!("Origin field in event is not a valid server name: {e}"))))
|
||||
})?;
|
||||
|
||||
let pdu_id = services
|
||||
.rooms
|
||||
.event_handler
|
||||
.handle_incoming_pdu(&origin, room_id, &event_id, value, true)
|
||||
.handle_incoming_pdu(recipient_user.server_name(), room_id, &event_id, value, true)
|
||||
.boxed()
|
||||
.await?
|
||||
.ok_or_else(|| {
|
||||
|
||||
@@ -36,7 +36,7 @@ pub use self::{
|
||||
room_version::RoomVersion,
|
||||
};
|
||||
use crate::{
|
||||
debug, debug_error, err,
|
||||
debug, err, error as log_error,
|
||||
matrix::{Event, StateKey},
|
||||
state_res::room_version::StateResolutionVersion,
|
||||
trace,
|
||||
@@ -173,7 +173,8 @@ where
|
||||
initial_state,
|
||||
&event_fetch,
|
||||
)
|
||||
.await?;
|
||||
.await
|
||||
.inspect_err(|_| log_error!("failed to calculate control events"))?;
|
||||
|
||||
debug!(count = resolved_control.len(), "resolved power events");
|
||||
trace!(map = ?resolved_control, "resolved power events");
|
||||
@@ -213,7 +214,8 @@ where
|
||||
resolved_control, // The control events are added to the final resolved state
|
||||
&event_fetch,
|
||||
)
|
||||
.await?;
|
||||
.await
|
||||
.inspect_err(|_| log_error!("failed to resolve left over state"))?;
|
||||
|
||||
// Ensure unconflicting state is in the final state
|
||||
resolved_state.extend(unconflicted);
|
||||
@@ -400,13 +402,17 @@ where
|
||||
.await;
|
||||
|
||||
let fetcher = async |event_id: OwnedEventId| {
|
||||
let pl = *event_to_pl
|
||||
.get(&event_id)
|
||||
.ok_or_else(|| Error::NotFound(String::new()))?;
|
||||
let pl = *event_to_pl.get(&event_id).ok_or_else(|| {
|
||||
Error::NotFound(format!(
|
||||
"event unexpectedly missing from power level map: {event_id}",
|
||||
))
|
||||
})?;
|
||||
|
||||
let ev = fetch_event(event_id)
|
||||
.await
|
||||
.ok_or_else(|| Error::NotFound(String::new()))?;
|
||||
let ev = fetch_event(event_id.clone()).await.ok_or_else(|| {
|
||||
Error::NotFound(format!(
|
||||
"event found in power level map but not in room graph: {event_id}",
|
||||
))
|
||||
})?;
|
||||
|
||||
Ok((pl, ev.origin_server_ts()))
|
||||
};
|
||||
@@ -758,7 +764,10 @@ where
|
||||
warn!("event {} failed the authentication check", event.event_id());
|
||||
},
|
||||
| Err(e) => {
|
||||
debug_error!("event {} failed the authentication check: {e}", event.event_id());
|
||||
log_error!(
|
||||
"failed to run authentication check on event {}: {e}",
|
||||
event.event_id()
|
||||
);
|
||||
return Err(e);
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user