mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-13 04:06:54 +00:00
fix: This is some bullshit I tell you
This commit is contained in:
8 files changed
+154
-148
No files matched your search
@@ -22,7 +22,7 @@ use futures::{FutureExt, StreamExt, TryStreamExt};
|
||||
use lettre::message::Mailbox;
|
||||
use ruma::{
|
||||
CanonicalJsonObject, CanonicalJsonValue, EventId, OwnedEventId, OwnedRoomId,
|
||||
OwnedRoomOrAliasId, OwnedServerName, RoomId, RoomVersionId, UInt,
|
||||
OwnedRoomOrAliasId, OwnedServerName, RoomId, RoomVersionId, ServerName, UInt,
|
||||
api::federation::event::get_room_state, events::AnyStateEvent, serde::Raw,
|
||||
};
|
||||
use service::rooms::{
|
||||
@@ -1138,3 +1138,32 @@ pub(super) async fn send_test_email(&self) -> Result {
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[admin_command]
|
||||
pub(super) async fn walk_missing_events(
|
||||
&self,
|
||||
latest: OwnedEventId,
|
||||
earliest: OwnedEventId,
|
||||
via: String,
|
||||
) -> Result {
|
||||
let earliest_pdu = self.services.rooms.timeline.get_pdu(&earliest).await?;
|
||||
let events = self
|
||||
.services
|
||||
.rooms
|
||||
.event_handler
|
||||
.backfill_missing_events(
|
||||
earliest_pdu.room_id_or_hash(),
|
||||
HashSet::from_iter(vec![latest]),
|
||||
vec![earliest],
|
||||
ServerName::parse(via)?,
|
||||
)
|
||||
.await?;
|
||||
self.write_str(&format!("Found {} events:\n\n```\n", events.len()))
|
||||
.await?;
|
||||
for (event_id, event) in events {
|
||||
self.write_str(&format!("{event_id}: {:?}\n\n", serde_json::to_string(&event)))
|
||||
.await?;
|
||||
}
|
||||
self.write_str("\n```").await?;
|
||||
Ok(())
|
||||
}
|
||||
@@ -32,6 +32,12 @@ pub enum DebugCommand {
|
||||
event_id: OwnedEventId,
|
||||
},
|
||||
|
||||
WalkMissingEvents {
|
||||
latest: OwnedEventId,
|
||||
earliest: OwnedEventId,
|
||||
via: String,
|
||||
},
|
||||
|
||||
/// Parse and print a PDU from a JSON
|
||||
///
|
||||
/// The PDU event is only checked for validity and is not added to the
|
||||
|
||||
Reference in new issue
Block a user