larcen state-res from ruma

This commit is contained in:
Jason Volk 2025-02-05 12:22:22 +00:00 committed by strawberry
parent b872f8e593
commit 0a9a9b3c92
24 changed files with 5082 additions and 33 deletions

View file

@ -3,12 +3,15 @@ use std::{
sync::Arc,
};
use conduwuit::{debug_warn, err, implement, PduEvent, Result};
use conduwuit::{
debug_warn, err, implement,
state_res::{self},
PduEvent, Result,
};
use futures::{future, FutureExt};
use ruma::{
int,
state_res::{self},
uint, CanonicalJsonValue, MilliSecondsSinceUnixEpoch, OwnedEventId, RoomId, ServerName, UInt,
int, uint, CanonicalJsonValue, MilliSecondsSinceUnixEpoch, OwnedEventId, RoomId, ServerName,
UInt,
};
use super::check_room_id;

View file

@ -3,10 +3,12 @@ use std::{
sync::Arc,
};
use conduwuit::{debug, debug_info, err, implement, trace, warn, Err, Error, PduEvent, Result};
use conduwuit::{
debug, debug_info, err, implement, state_res, trace, warn, Err, Error, PduEvent, Result,
};
use futures::{future::ready, TryFutureExt};
use ruma::{
api::client::error::ErrorKind, events::StateEventType, state_res, CanonicalJsonObject,
api::client::error::ErrorKind, events::StateEventType, CanonicalJsonObject,
CanonicalJsonValue, EventId, RoomId, ServerName,
};

View file

@ -19,12 +19,12 @@ use std::{
use conduwuit::{
utils::{MutexMap, TryFutureExtExt},
Err, PduEvent, Result, Server,
Err, PduEvent, Result, RoomVersion, Server,
};
use futures::TryFutureExt;
use ruma::{
events::room::create::RoomCreateEventContent, state_res::RoomVersion, OwnedEventId,
OwnedRoomId, RoomId, RoomVersionId,
events::room::create::RoomCreateEventContent, OwnedEventId, OwnedRoomId, RoomId,
RoomVersionId,
};
use crate::{globals, rooms, sending, server_keys, Dep};

View file

@ -5,15 +5,14 @@ use std::{
};
use conduwuit::{
err, implement, trace,
err, implement,
state_res::{self, StateMap},
trace,
utils::stream::{automatic_width, IterStream, ReadyExt, TryWidebandExt, WidebandExt},
Error, Result,
};
use futures::{future::try_join, FutureExt, StreamExt, TryFutureExt, TryStreamExt};
use ruma::{
state_res::{self, StateMap},
OwnedEventId, RoomId, RoomVersionId,
};
use ruma::{OwnedEventId, RoomId, RoomVersionId};
use crate::rooms::state_compressor::CompressedState;

View file

@ -8,10 +8,10 @@ use std::{
use conduwuit::{
debug, err, implement, trace,
utils::stream::{BroadbandExt, IterStream, ReadyExt, TryBroadbandExt, TryWidebandExt},
PduEvent, Result,
PduEvent, Result, StateMap,
};
use futures::{future::try_join, FutureExt, StreamExt, TryFutureExt, TryStreamExt};
use ruma::{state_res::StateMap, OwnedEventId, RoomId, RoomVersionId};
use ruma::{OwnedEventId, RoomId, RoomVersionId};
use crate::rooms::short::ShortStateHash;

View file

@ -1,16 +1,12 @@
use std::{borrow::Borrow, collections::BTreeMap, iter::once, sync::Arc, time::Instant};
use conduwuit::{
debug, debug_info, err, implement, trace,
debug, debug_info, err, implement, state_res, trace,
utils::stream::{BroadbandExt, ReadyExt},
warn, Err, PduEvent, Result,
warn, Err, EventTypeExt, PduEvent, Result,
};
use futures::{future::ready, FutureExt, StreamExt};
use ruma::{
events::StateEventType,
state_res::{self, EventTypeExt},
CanonicalJsonValue, RoomId, ServerName,
};
use ruma::{events::StateEventType, CanonicalJsonValue, RoomId, ServerName};
use super::{get_room_version_id, to_room_version};
use crate::rooms::{

View file

@ -3,6 +3,7 @@ use std::{collections::HashMap, fmt::Write, iter::once, sync::Arc};
use conduwuit::{
err,
result::FlatOk,
state_res::{self, StateMap},
utils::{
calculate_hash,
stream::{BroadbandExt, TryIgnore},
@ -20,7 +21,6 @@ use ruma::{
AnyStrippedStateEvent, StateEventType, TimelineEventType,
},
serde::Raw,
state_res::{self, StateMap},
EventId, OwnedEventId, OwnedRoomId, RoomId, RoomVersionId, UserId,
};

View file

@ -12,6 +12,7 @@ use std::{
use conduwuit::{
at, debug, debug_warn, err, error, implement, info,
pdu::{gen_event_id, EventHash, PduBuilder, PduCount, PduEvent},
state_res::{self, Event, RoomVersion},
utils::{
self, future::TryExtExt, stream::TryIgnore, IterStream, MutexMap, MutexMapGuard, ReadyExt,
},
@ -36,7 +37,6 @@ use ruma::{
GlobalAccountDataEventType, StateEventType, TimelineEventType,
},
push::{Action, Ruleset, Tweak},
state_res::{self, Event, RoomVersion},
uint, CanonicalJsonObject, CanonicalJsonValue, EventId, OwnedEventId, OwnedRoomId,
OwnedServerName, RoomId, RoomVersionId, ServerName, UserId,
};