move core::pdu and core::state_res into core::matrix::

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2025-04-04 03:30:13 +00:00
parent 4e5b87d0cd
commit 532dfd004d
91 changed files with 266 additions and 205 deletions

View file

@ -1,6 +1,6 @@
use std::collections::BTreeMap;
use conduwuit::{Err, Result, debug_info, debug_warn, error, implement};
use conduwuit::{Err, Result, debug_info, debug_warn, error, implement, matrix::pdu::PduBuilder};
use ruma::{
RoomId, UserId,
events::{
@ -14,8 +14,6 @@ use ruma::{
},
};
use crate::pdu::PduBuilder;
/// Invite the user to the conduwuit admin room.
///
/// This is equivalent to granting server admin privileges.

View file

@ -31,7 +31,6 @@ pub mod users;
extern crate conduwuit_core as conduwuit;
extern crate conduwuit_database as database;
pub use conduwuit::{PduBuilder, PduCount, PduEvent, pdu};
pub(crate) use service::{Args, Dep, Service};
pub use crate::services::Services;

View file

@ -5,7 +5,9 @@ use std::{
};
use conduwuit::{
PduEvent, Result, StateMap, debug, err, implement, trace,
Result, debug, err, implement,
matrix::{PduEvent, StateMap},
trace,
utils::stream::{BroadbandExt, IterStream, ReadyExt, TryBroadbandExt, TryWidebandExt},
};
use futures::{FutureExt, StreamExt, TryFutureExt, TryStreamExt, future::try_join};

View file

@ -1,7 +1,8 @@
use std::{borrow::Borrow, collections::BTreeMap, iter::once, sync::Arc, time::Instant};
use conduwuit::{
Err, EventTypeExt, PduEvent, Result, StateKey, debug, debug_info, err, implement, state_res,
Err, Result, debug, debug_info, err, implement,
matrix::{EventTypeExt, PduEvent, StateKey, state_res},
trace,
utils::stream::{BroadbandExt, ReadyExt},
warn,

View file

@ -1,11 +1,9 @@
use std::sync::Arc;
use conduwuit::{Result, implement};
use database::{Deserialized, Json, Map};
use conduwuit::{Result, implement, matrix::pdu::PduEvent};
use conduwuit_database::{Deserialized, Json, Map};
use ruma::{CanonicalJsonObject, EventId};
use crate::PduEvent;
pub struct Service {
db: Data,
}

View file

@ -2,7 +2,11 @@ mod data;
use std::{collections::BTreeMap, sync::Arc};
use conduwuit::{PduCount, PduId, RawPduId, Result, debug, err, warn};
use conduwuit::{
Result, debug, err,
matrix::pdu::{PduCount, PduId, RawPduId},
warn,
};
use futures::{Stream, TryFutureExt, try_join};
use ruma::{
OwnedEventId, OwnedUserId, RoomId, UserId,

View file

@ -1,7 +1,7 @@
use std::{borrow::Borrow, fmt::Debug, mem::size_of_val, sync::Arc};
pub use conduwuit::pdu::{ShortEventId, ShortId, ShortRoomId, ShortStateKey};
use conduwuit::{Result, StateKey, err, implement, utils, utils::IterStream};
pub use conduwuit::matrix::pdu::{ShortEventId, ShortId, ShortRoomId, ShortStateKey};
use conduwuit::{Result, err, implement, matrix::StateKey, utils, utils::IterStream};
use database::{Deserialized, Get, Map, Qry};
use futures::{Stream, StreamExt};
use ruma::{EventId, RoomId, events::StateEventType};

View file

@ -1,6 +1,9 @@
use std::borrow::Borrow;
use conduwuit::{PduEvent, Result, StateKey, err, implement};
use conduwuit::{
Result, err, implement,
matrix::{PduEvent, StateKey},
};
use futures::{Stream, StreamExt, TryFutureExt};
use ruma::{EventId, RoomId, events::StateEventType};
use serde::Deserialize;

View file

@ -1,13 +1,15 @@
use std::{borrow::Borrow, ops::Deref, sync::Arc};
use conduwuit::{
PduEvent, Result, StateKey, at, err, implement, pair_of,
Result, at, err, implement,
matrix::{PduEvent, StateKey},
pair_of,
utils::{
result::FlatOk,
stream::{BroadbandExt, IterStream, ReadyExt, TryIgnore},
},
};
use database::Deserialized;
use conduwuit_database::Deserialized;
use futures::{FutureExt, Stream, StreamExt, TryFutureExt, future::try_join, pin_mut};
use ruma::{
EventId, OwnedEventId, UserId,

View file

@ -1,13 +1,14 @@
use std::{collections::BTreeMap, sync::Arc};
use conduwuit::{
PduCount, PduEvent, PduId, RawPduId, Result, err,
Result, err,
matrix::pdu::{PduCount, PduEvent, PduId, RawPduId},
utils::{
ReadyExt,
stream::{TryIgnore, WidebandExt},
},
};
use database::{Deserialized, Map};
use conduwuit_database::{Deserialized, Map};
use futures::{Stream, StreamExt};
use ruma::{
CanonicalJsonValue, EventId, OwnedUserId, RoomId, UserId,

View file

@ -10,16 +10,19 @@ use std::{
};
use async_trait::async_trait;
pub use conduwuit::matrix::pdu::{PduId, RawPduId};
use conduwuit::{
Err, Error, Result, Server, at, debug, debug_warn, err, error, implement, info,
pdu::{EventHash, PduBuilder, PduCount, PduEvent, gen_event_id},
state_res::{self, Event, RoomVersion},
matrix::{
Event,
pdu::{EventHash, PduBuilder, PduCount, PduEvent, gen_event_id},
state_res::{self, RoomVersion},
},
utils::{
self, IterStream, MutexMap, MutexMapGuard, ReadyExt, future::TryExtExt, stream::TryIgnore,
},
validated, warn,
};
pub use conduwuit::{PduId, RawPduId};
use futures::{
Future, FutureExt, Stream, StreamExt, TryStreamExt, future, future::ready, pin_mut,
};