@@ -2,11 +2,6 @@ mod remote;
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use conduwuit::{
|
||||
Err, Result, Server, err,
|
||||
utils::{ReadyExt, stream::TryIgnore},
|
||||
};
|
||||
use database::{Deserialized, Ignore, Interfix, Map};
|
||||
use futures::{Stream, StreamExt, TryFutureExt};
|
||||
use ruma::{
|
||||
OwnedRoomId, OwnedServerName, OwnedUserId, RoomAliasId, RoomId, RoomOrAliasId, UserId,
|
||||
@@ -15,6 +10,11 @@ use ruma::{
|
||||
room::power_levels::{RoomPowerLevels, RoomPowerLevelsEventContent},
|
||||
},
|
||||
};
|
||||
use tuwunel_core::{
|
||||
Err, Result, Server, err,
|
||||
utils::{ReadyExt, stream::TryIgnore},
|
||||
};
|
||||
use tuwunel_database::{Deserialized, Ignore, Interfix, Map};
|
||||
|
||||
use crate::{Dep, admin, appservice, appservice::RegistrationInfo, globals, rooms, sending};
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use std::iter::once;
|
||||
|
||||
use conduwuit::{Result, debug, debug_error, err, implement};
|
||||
use federation::query::get_room_information::v1::Response;
|
||||
use ruma::{OwnedRoomId, OwnedServerName, RoomAliasId, ServerName, api::federation};
|
||||
use tuwunel_core::{Result, debug, debug_error, err, implement};
|
||||
|
||||
#[implement(super::Service)]
|
||||
pub(super) async fn remote_resolve(
|
||||
|
||||
@@ -3,9 +3,9 @@ use std::{
|
||||
sync::{Arc, Mutex},
|
||||
};
|
||||
|
||||
use conduwuit::{Err, Result, err, utils, utils::math::usize_from_f64};
|
||||
use database::Map;
|
||||
use lru_cache::LruCache;
|
||||
use tuwunel_core::{Err, Result, err, utils, utils::math::usize_from_f64};
|
||||
use tuwunel_database::Map;
|
||||
|
||||
use crate::rooms::short::ShortEventId;
|
||||
|
||||
|
||||
@@ -7,7 +7,9 @@ use std::{
|
||||
time::Instant,
|
||||
};
|
||||
|
||||
use conduwuit::{
|
||||
use futures::{FutureExt, Stream, StreamExt, TryFutureExt, TryStreamExt};
|
||||
use ruma::{EventId, OwnedEventId, RoomId};
|
||||
use tuwunel_core::{
|
||||
Err, Result, at, debug, debug_error, implement, trace,
|
||||
utils::{
|
||||
IterStream,
|
||||
@@ -15,8 +17,6 @@ use conduwuit::{
|
||||
},
|
||||
validated, warn,
|
||||
};
|
||||
use futures::{FutureExt, Stream, StreamExt, TryFutureExt, TryStreamExt};
|
||||
use ruma::{EventId, OwnedEventId, RoomId};
|
||||
|
||||
use self::data::Data;
|
||||
use crate::{Dep, rooms, rooms::short::ShortEventId};
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use conduwuit::{Result, implement, utils::stream::TryIgnore};
|
||||
use database::Map;
|
||||
use futures::Stream;
|
||||
use ruma::{RoomId, api::client::room::Visibility};
|
||||
use tuwunel_core::{Result, implement, utils::stream::TryIgnore};
|
||||
use tuwunel_database::Map;
|
||||
|
||||
pub struct Service {
|
||||
db: Data,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use conduwuit::{Err, Result, debug, implement, trace, warn};
|
||||
use ruma::{
|
||||
RoomId, ServerName,
|
||||
events::{StateEventType, room::server_acl::RoomServerAclEventContent},
|
||||
};
|
||||
use tuwunel_core::{Err, Result, debug, implement, trace, warn};
|
||||
|
||||
/// Returns Ok if the acl allows the server
|
||||
#[implement(super::Service)]
|
||||
|
||||
@@ -3,13 +3,13 @@ use std::{
|
||||
time::Instant,
|
||||
};
|
||||
|
||||
use conduwuit::{
|
||||
PduEvent, debug, debug_error, debug_warn, implement, pdu, trace,
|
||||
utils::continue_exponential_backoff_secs, warn,
|
||||
};
|
||||
use ruma::{
|
||||
CanonicalJsonValue, OwnedEventId, RoomId, ServerName, api::federation::event::get_event,
|
||||
};
|
||||
use tuwunel_core::{
|
||||
PduEvent, debug, debug_error, debug_warn, implement, pdu, trace,
|
||||
utils::continue_exponential_backoff_secs, warn,
|
||||
};
|
||||
|
||||
use super::get_room_version_id;
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
use std::collections::{BTreeMap, HashMap, HashSet, VecDeque};
|
||||
|
||||
use conduwuit::{
|
||||
PduEvent, Result, debug_warn, err, implement,
|
||||
state_res::{self},
|
||||
};
|
||||
use futures::{FutureExt, future};
|
||||
use ruma::{
|
||||
CanonicalJsonValue, MilliSecondsSinceUnixEpoch, OwnedEventId, RoomId, ServerName, UInt, int,
|
||||
uint,
|
||||
};
|
||||
use tuwunel_core::{
|
||||
PduEvent, Result, debug_warn, err, implement,
|
||||
state_res::{self},
|
||||
};
|
||||
|
||||
use super::check_room_id;
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
use std::collections::{HashMap, hash_map};
|
||||
|
||||
use conduwuit::{Err, Error, PduEvent, Result, debug, debug_warn, implement};
|
||||
use futures::FutureExt;
|
||||
use ruma::{
|
||||
EventId, OwnedEventId, RoomId, ServerName, api::federation::event::get_room_state_ids,
|
||||
events::StateEventType,
|
||||
};
|
||||
use tuwunel_core::{Err, Error, PduEvent, Result, debug, debug_warn, implement};
|
||||
|
||||
use crate::rooms::short::ShortStateKey;
|
||||
|
||||
|
||||
@@ -3,15 +3,15 @@ use std::{
|
||||
time::Instant,
|
||||
};
|
||||
|
||||
use conduwuit::{
|
||||
Err, Result, debug, debug::INFO_SPAN_LEVEL, defer, err, implement, utils::stream::IterStream,
|
||||
warn,
|
||||
};
|
||||
use futures::{
|
||||
FutureExt, TryFutureExt, TryStreamExt,
|
||||
future::{OptionFuture, try_join5},
|
||||
};
|
||||
use ruma::{CanonicalJsonValue, EventId, RoomId, ServerName, UserId, events::StateEventType};
|
||||
use tuwunel_core::{
|
||||
Err, Result, debug, debug::INFO_SPAN_LEVEL, defer, err, implement, utils::stream::IterStream,
|
||||
warn,
|
||||
};
|
||||
|
||||
use crate::rooms::timeline::RawPduId;
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
use std::collections::{BTreeMap, HashMap, hash_map};
|
||||
|
||||
use conduwuit::{
|
||||
Err, Error, PduEvent, Result, debug, debug_info, err, implement, state_res, trace, warn,
|
||||
};
|
||||
use futures::future::ready;
|
||||
use ruma::{
|
||||
CanonicalJsonObject, CanonicalJsonValue, EventId, RoomId, ServerName,
|
||||
api::client::error::ErrorKind, events::StateEventType,
|
||||
};
|
||||
use tuwunel_core::{
|
||||
Err, Error, PduEvent, Result, debug, debug_info, err, implement, state_res, trace, warn,
|
||||
};
|
||||
|
||||
use super::{check_room_id, get_room_version_id, to_room_version};
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
use std::{collections::BTreeMap, time::Instant};
|
||||
|
||||
use conduwuit::{
|
||||
use ruma::{CanonicalJsonValue, EventId, RoomId, ServerName, UInt};
|
||||
use tuwunel_core::{
|
||||
Err, PduEvent, Result, debug, debug::INFO_SPAN_LEVEL, defer, implement,
|
||||
utils::continue_exponential_backoff_secs,
|
||||
};
|
||||
use ruma::{CanonicalJsonValue, EventId, RoomId, ServerName, UInt};
|
||||
|
||||
#[implement(super::Service)]
|
||||
#[allow(clippy::type_complexity)]
|
||||
|
||||
@@ -18,11 +18,11 @@ use std::{
|
||||
};
|
||||
|
||||
use async_trait::async_trait;
|
||||
use conduwuit::{Err, PduEvent, Result, RoomVersion, Server, utils::MutexMap};
|
||||
use ruma::{
|
||||
OwnedEventId, OwnedRoomId, RoomId, RoomVersionId,
|
||||
events::room::create::RoomCreateEventContent,
|
||||
};
|
||||
use tuwunel_core::{Err, PduEvent, Result, RoomVersion, Server, utils::MutexMap};
|
||||
|
||||
use crate::{Dep, globals, rooms, sending, server_keys};
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use conduwuit::{Result, err, implement, pdu::gen_event_id_canonical_json, result::FlatOk};
|
||||
use ruma::{CanonicalJsonObject, CanonicalJsonValue, OwnedEventId, OwnedRoomId};
|
||||
use serde_json::value::RawValue as RawJsonValue;
|
||||
use tuwunel_core::{Result, err, implement, pdu::gen_event_id_canonical_json, result::FlatOk};
|
||||
|
||||
type Parsed = (OwnedRoomId, OwnedEventId, CanonicalJsonObject);
|
||||
|
||||
|
||||
@@ -4,14 +4,14 @@ use std::{
|
||||
sync::Arc,
|
||||
};
|
||||
|
||||
use conduwuit::{
|
||||
use futures::{FutureExt, StreamExt, TryFutureExt, TryStreamExt, future::try_join};
|
||||
use ruma::{OwnedEventId, RoomId, RoomVersionId};
|
||||
use tuwunel_core::{
|
||||
Error, Result, err, implement,
|
||||
state_res::{self, StateMap},
|
||||
trace,
|
||||
utils::stream::{IterStream, ReadyExt, TryWidebandExt, WidebandExt, automatic_width},
|
||||
};
|
||||
use futures::{FutureExt, StreamExt, TryFutureExt, TryStreamExt, future::try_join};
|
||||
use ruma::{OwnedEventId, RoomId, RoomVersionId};
|
||||
|
||||
use crate::rooms::state_compressor::CompressedState;
|
||||
|
||||
|
||||
@@ -4,14 +4,14 @@ use std::{
|
||||
iter::Iterator,
|
||||
};
|
||||
|
||||
use conduwuit::{
|
||||
use futures::{FutureExt, StreamExt, TryFutureExt, TryStreamExt, future::try_join};
|
||||
use ruma::{OwnedEventId, RoomId, RoomVersionId};
|
||||
use tuwunel_core::{
|
||||
Result, debug, err, implement,
|
||||
matrix::{PduEvent, StateMap},
|
||||
trace,
|
||||
utils::stream::{BroadbandExt, IterStream, ReadyExt, TryBroadbandExt, TryWidebandExt},
|
||||
};
|
||||
use futures::{FutureExt, StreamExt, TryFutureExt, TryStreamExt, future::try_join};
|
||||
use ruma::{OwnedEventId, RoomId, RoomVersionId};
|
||||
|
||||
use crate::rooms::short::ShortStateHash;
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
use std::{borrow::Borrow, collections::BTreeMap, iter::once, sync::Arc, time::Instant};
|
||||
|
||||
use conduwuit::{
|
||||
use futures::{FutureExt, StreamExt, future::ready};
|
||||
use ruma::{CanonicalJsonValue, RoomId, ServerName, events::StateEventType};
|
||||
use tuwunel_core::{
|
||||
Err, Result, debug, debug_info, err, implement,
|
||||
matrix::{EventTypeExt, PduEvent, StateKey, state_res},
|
||||
trace,
|
||||
utils::stream::{BroadbandExt, ReadyExt},
|
||||
warn,
|
||||
};
|
||||
use futures::{FutureExt, StreamExt, future::ready};
|
||||
use ruma::{CanonicalJsonValue, RoomId, ServerName, events::StateEventType};
|
||||
|
||||
use super::{get_room_version_id, to_room_version};
|
||||
use crate::rooms::{
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
use std::{collections::HashSet, sync::Arc};
|
||||
|
||||
use conduwuit::{
|
||||
use futures::{Stream, StreamExt, pin_mut};
|
||||
use ruma::{DeviceId, OwnedUserId, RoomId, UserId, api::client::filter::LazyLoadOptions};
|
||||
use tuwunel_core::{
|
||||
Result, implement,
|
||||
utils::{IterStream, ReadyExt, stream::TryIgnore},
|
||||
};
|
||||
use database::{Database, Deserialized, Handle, Interfix, Map, Qry};
|
||||
use futures::{Stream, StreamExt, pin_mut};
|
||||
use ruma::{DeviceId, OwnedUserId, RoomId, UserId, api::client::filter::LazyLoadOptions};
|
||||
use tuwunel_database::{Database, Deserialized, Handle, Interfix, Map, Qry};
|
||||
|
||||
pub struct Service {
|
||||
db: Data,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use conduwuit::{Result, implement, utils::stream::TryIgnore};
|
||||
use database::Map;
|
||||
use futures::{Stream, StreamExt};
|
||||
use ruma::RoomId;
|
||||
use tuwunel_core::{Result, implement, utils::stream::TryIgnore};
|
||||
use tuwunel_database::Map;
|
||||
|
||||
use crate::{Dep, rooms};
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use conduwuit::{Result, implement, matrix::pdu::PduEvent};
|
||||
use conduwuit_database::{Deserialized, Json, Map};
|
||||
use ruma::{CanonicalJsonObject, EventId};
|
||||
use tuwunel_core::{Result, implement, matrix::pdu::PduEvent};
|
||||
use tuwunel_database::{Deserialized, Json, Map};
|
||||
|
||||
pub struct Service {
|
||||
db: Data,
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
use std::{mem::size_of, sync::Arc};
|
||||
|
||||
use conduwuit::{
|
||||
use futures::{Stream, StreamExt};
|
||||
use ruma::{EventId, RoomId, UserId, api::Direction};
|
||||
use tuwunel_core::{
|
||||
PduCount, PduEvent,
|
||||
arrayvec::ArrayVec,
|
||||
result::LogErr,
|
||||
@@ -10,9 +12,7 @@ use conduwuit::{
|
||||
u64_from_u8,
|
||||
},
|
||||
};
|
||||
use database::Map;
|
||||
use futures::{Stream, StreamExt};
|
||||
use ruma::{EventId, RoomId, UserId, api::Direction};
|
||||
use tuwunel_database::Map;
|
||||
|
||||
use crate::{
|
||||
Dep, rooms,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
mod data;
|
||||
use std::sync::Arc;
|
||||
|
||||
use conduwuit::{PduCount, Result};
|
||||
use futures::{StreamExt, future::try_join};
|
||||
use ruma::{EventId, RoomId, UserId, api::Direction};
|
||||
use tuwunel_core::{PduCount, Result};
|
||||
|
||||
use self::data::{Data, PdusIterItem};
|
||||
use crate::{Dep, rooms};
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use conduwuit::{
|
||||
Result,
|
||||
utils::{ReadyExt, stream::TryIgnore},
|
||||
};
|
||||
use database::{Deserialized, Json, Map};
|
||||
use futures::{Stream, StreamExt};
|
||||
use ruma::{
|
||||
CanonicalJsonObject, RoomId, UserId,
|
||||
events::{AnySyncEphemeralRoomEvent, receipt::ReceiptEvent},
|
||||
serde::Raw,
|
||||
};
|
||||
use tuwunel_core::{
|
||||
Result,
|
||||
utils::{ReadyExt, stream::TryIgnore},
|
||||
};
|
||||
use tuwunel_database::{Deserialized, Json, Map};
|
||||
|
||||
use crate::{Dep, globals};
|
||||
|
||||
|
||||
@@ -2,11 +2,6 @@ mod data;
|
||||
|
||||
use std::{collections::BTreeMap, sync::Arc};
|
||||
|
||||
use conduwuit::{
|
||||
Result, debug, err,
|
||||
matrix::pdu::{PduCount, PduId, RawPduId},
|
||||
warn,
|
||||
};
|
||||
use futures::{Stream, TryFutureExt, try_join};
|
||||
use ruma::{
|
||||
OwnedEventId, OwnedUserId, RoomId, UserId,
|
||||
@@ -16,6 +11,11 @@ use ruma::{
|
||||
},
|
||||
serde::Raw,
|
||||
};
|
||||
use tuwunel_core::{
|
||||
Result, debug, err,
|
||||
matrix::pdu::{PduCount, PduId, RawPduId},
|
||||
warn,
|
||||
};
|
||||
|
||||
use self::data::{Data, ReceiptItem};
|
||||
use crate::{Dep, rooms, sending};
|
||||
@@ -161,7 +161,7 @@ where
|
||||
}
|
||||
let content = ReceiptEventContent::from_iter(json);
|
||||
|
||||
conduwuit::trace!(?content);
|
||||
tuwunel_core::trace!(?content);
|
||||
Raw::from_json(
|
||||
serde_json::value::to_raw_value(&SyncEphemeralRoomEvent { content })
|
||||
.expect("received valid json"),
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use conduwuit::{
|
||||
use futures::{Stream, StreamExt};
|
||||
use ruma::{RoomId, UserId, api::client::search::search_events::v3::Criteria};
|
||||
use tuwunel_core::{
|
||||
PduCount, PduEvent, Result,
|
||||
arrayvec::ArrayVec,
|
||||
implement,
|
||||
@@ -9,9 +11,7 @@ use conduwuit::{
|
||||
stream::{TryIgnore, WidebandExt},
|
||||
},
|
||||
};
|
||||
use database::{Map, keyval::Val};
|
||||
use futures::{Stream, StreamExt};
|
||||
use ruma::{RoomId, UserId, api::client::search::search_events::v3::Criteria};
|
||||
use tuwunel_database::{Map, keyval::Val};
|
||||
|
||||
use crate::{
|
||||
Dep, rooms,
|
||||
@@ -224,7 +224,7 @@ fn make_prefix(shortroomid: ShortRoomId, word: &str) -> TokenId {
|
||||
let mut key = TokenId::new();
|
||||
key.extend_from_slice(&shortroomid.to_be_bytes());
|
||||
key.extend_from_slice(word.as_bytes());
|
||||
key.push(database::SEP);
|
||||
key.push(tuwunel_database::SEP);
|
||||
key
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
use std::{borrow::Borrow, fmt::Debug, mem::size_of_val, sync::Arc};
|
||||
|
||||
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};
|
||||
use serde::Deserialize;
|
||||
pub use tuwunel_core::matrix::pdu::{ShortEventId, ShortId, ShortRoomId, ShortStateKey};
|
||||
use tuwunel_core::{Result, err, implement, matrix::StateKey, utils, utils::IterStream};
|
||||
use tuwunel_database::{Deserialized, Get, Map, Qry};
|
||||
|
||||
use crate::{Dep, globals};
|
||||
|
||||
|
||||
@@ -5,15 +5,6 @@ mod tests;
|
||||
use std::{fmt::Write, sync::Arc};
|
||||
|
||||
use async_trait::async_trait;
|
||||
use conduwuit::{
|
||||
Err, Error, PduEvent, Result, implement,
|
||||
utils::{
|
||||
IterStream,
|
||||
future::{BoolExt, TryExtExt},
|
||||
math::usize_from_f64,
|
||||
stream::{BroadbandExt, ReadyExt},
|
||||
},
|
||||
};
|
||||
use futures::{FutureExt, Stream, StreamExt, TryFutureExt, pin_mut, stream::FuturesUnordered};
|
||||
use lru_cache::LruCache;
|
||||
use ruma::{
|
||||
@@ -33,6 +24,15 @@ use ruma::{
|
||||
space::SpaceRoomJoinRule,
|
||||
};
|
||||
use tokio::sync::{Mutex, MutexGuard};
|
||||
use tuwunel_core::{
|
||||
Err, Error, PduEvent, Result, implement,
|
||||
utils::{
|
||||
IterStream,
|
||||
future::{BoolExt, TryExtExt},
|
||||
math::usize_from_f64,
|
||||
stream::{BroadbandExt, ReadyExt},
|
||||
},
|
||||
};
|
||||
|
||||
pub use self::pagination_token::PaginationToken;
|
||||
use crate::{Dep, rooms, sending};
|
||||
|
||||
@@ -3,8 +3,8 @@ use std::{
|
||||
str::FromStr,
|
||||
};
|
||||
|
||||
use conduwuit::{Error, Result};
|
||||
use ruma::{UInt, api::client::error::ErrorKind};
|
||||
use tuwunel_core::{Error, Result};
|
||||
|
||||
use crate::rooms::short::ShortRoomId;
|
||||
|
||||
|
||||
@@ -1,17 +1,6 @@
|
||||
use std::{collections::HashMap, fmt::Write, iter::once, sync::Arc};
|
||||
|
||||
use async_trait::async_trait;
|
||||
use conduwuit::{
|
||||
PduEvent, Result, err,
|
||||
result::FlatOk,
|
||||
state_res::{self, StateMap},
|
||||
utils::{
|
||||
IterStream, MutexMap, MutexMapGuard, ReadyExt, calculate_hash,
|
||||
stream::{BroadbandExt, TryIgnore},
|
||||
},
|
||||
warn,
|
||||
};
|
||||
use database::{Deserialized, Ignore, Interfix, Map};
|
||||
use futures::{
|
||||
FutureExt, Stream, StreamExt, TryFutureExt, TryStreamExt, future::join_all, pin_mut,
|
||||
};
|
||||
@@ -23,6 +12,17 @@ use ruma::{
|
||||
},
|
||||
serde::Raw,
|
||||
};
|
||||
use tuwunel_core::{
|
||||
PduEvent, Result, err,
|
||||
result::FlatOk,
|
||||
state_res::{self, StateMap},
|
||||
utils::{
|
||||
IterStream, MutexMap, MutexMapGuard, ReadyExt, calculate_hash,
|
||||
stream::{BroadbandExt, TryIgnore},
|
||||
},
|
||||
warn,
|
||||
};
|
||||
use tuwunel_database::{Deserialized, Ignore, Interfix, Map};
|
||||
|
||||
use crate::{
|
||||
Dep, globals, rooms,
|
||||
|
||||
@@ -6,8 +6,6 @@ mod user_can;
|
||||
use std::sync::Arc;
|
||||
|
||||
use async_trait::async_trait;
|
||||
use conduwuit::{Result, err};
|
||||
use database::Map;
|
||||
use ruma::{
|
||||
EventEncryptionAlgorithm, JsOption, OwnedRoomAliasId, RoomId, UserId,
|
||||
events::{
|
||||
@@ -27,6 +25,8 @@ use ruma::{
|
||||
},
|
||||
room::RoomType,
|
||||
};
|
||||
use tuwunel_core::{Result, err};
|
||||
use tuwunel_database::Map;
|
||||
|
||||
use crate::{Dep, rooms};
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
use std::borrow::Borrow;
|
||||
|
||||
use conduwuit::{
|
||||
Result, err, implement,
|
||||
matrix::{PduEvent, StateKey},
|
||||
};
|
||||
use futures::{Stream, StreamExt, TryFutureExt};
|
||||
use ruma::{EventId, RoomId, events::StateEventType};
|
||||
use serde::Deserialize;
|
||||
use tuwunel_core::{
|
||||
Result, err, implement,
|
||||
matrix::{PduEvent, StateKey},
|
||||
};
|
||||
|
||||
/// Returns a single PDU from `room_id` with key (`event_type`,`state_key`).
|
||||
#[implement(super::Service)]
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
use conduwuit::{implement, utils::stream::ReadyExt};
|
||||
use futures::StreamExt;
|
||||
use ruma::{
|
||||
EventId, RoomId, ServerName,
|
||||
@@ -7,6 +6,7 @@ use ruma::{
|
||||
room::history_visibility::{HistoryVisibility, RoomHistoryVisibilityEventContent},
|
||||
},
|
||||
};
|
||||
use tuwunel_core::{implement, utils::stream::ReadyExt};
|
||||
|
||||
/// Whether a server is allowed to see an event through federation, based on
|
||||
/// the room's history_visibility at that event's state.
|
||||
|
||||
@@ -1,15 +1,5 @@
|
||||
use std::{borrow::Borrow, ops::Deref, sync::Arc};
|
||||
|
||||
use conduwuit::{
|
||||
Result, at, err, implement,
|
||||
matrix::{PduEvent, StateKey},
|
||||
pair_of,
|
||||
utils::{
|
||||
result::FlatOk,
|
||||
stream::{BroadbandExt, IterStream, ReadyExt, TryIgnore},
|
||||
},
|
||||
};
|
||||
use conduwuit_database::Deserialized;
|
||||
use futures::{FutureExt, Stream, StreamExt, TryFutureExt, future::try_join, pin_mut};
|
||||
use ruma::{
|
||||
EventId, OwnedEventId, UserId,
|
||||
@@ -19,6 +9,16 @@ use ruma::{
|
||||
},
|
||||
};
|
||||
use serde::Deserialize;
|
||||
use tuwunel_core::{
|
||||
Result, at, err, implement,
|
||||
matrix::{PduEvent, StateKey},
|
||||
pair_of,
|
||||
utils::{
|
||||
result::FlatOk,
|
||||
stream::{BroadbandExt, IterStream, ReadyExt, TryIgnore},
|
||||
},
|
||||
};
|
||||
use tuwunel_database::Deserialized;
|
||||
|
||||
use crate::rooms::{
|
||||
short::{ShortEventId, ShortStateHash, ShortStateKey},
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
use conduwuit::{Err, Result, implement, pdu::PduBuilder};
|
||||
use ruma::{
|
||||
EventId, RoomId, UserId,
|
||||
events::{
|
||||
@@ -10,6 +9,7 @@ use ruma::{
|
||||
},
|
||||
},
|
||||
};
|
||||
use tuwunel_core::{Err, Result, implement, pdu::PduBuilder};
|
||||
|
||||
use crate::rooms::state::RoomMutexGuard;
|
||||
|
||||
|
||||
@@ -3,13 +3,6 @@ use std::{
|
||||
sync::{Arc, RwLock},
|
||||
};
|
||||
|
||||
use conduwuit::{
|
||||
Result, is_not_empty,
|
||||
result::LogErr,
|
||||
utils::{ReadyExt, StreamTools, stream::TryIgnore},
|
||||
warn,
|
||||
};
|
||||
use database::{Deserialized, Ignore, Interfix, Json, Map, serialize_key};
|
||||
use futures::{Stream, StreamExt, future::join5, pin_mut, stream::iter};
|
||||
use itertools::Itertools;
|
||||
use ruma::{
|
||||
@@ -27,6 +20,13 @@ use ruma::{
|
||||
int,
|
||||
serde::Raw,
|
||||
};
|
||||
use tuwunel_core::{
|
||||
Result, is_not_empty,
|
||||
result::LogErr,
|
||||
utils::{ReadyExt, StreamTools, stream::TryIgnore},
|
||||
warn,
|
||||
};
|
||||
use tuwunel_database::{Deserialized, Ignore, Interfix, Json, Map, serialize_key};
|
||||
|
||||
use crate::{Dep, account_data, appservice::RegistrationInfo, config, globals, rooms, users};
|
||||
|
||||
@@ -499,7 +499,7 @@ impl Service {
|
||||
user_a: &'a UserId,
|
||||
user_b: &'a UserId,
|
||||
) -> impl Stream<Item = &RoomId> + Send + 'a {
|
||||
use conduwuit::utils::set;
|
||||
use tuwunel_core::utils::set;
|
||||
|
||||
let a = self.rooms_joined(user_a);
|
||||
let b = self.rooms_joined(user_b);
|
||||
|
||||
@@ -6,16 +6,16 @@ use std::{
|
||||
};
|
||||
|
||||
use async_trait::async_trait;
|
||||
use conduwuit::{
|
||||
use futures::{Stream, StreamExt};
|
||||
use lru_cache::LruCache;
|
||||
use ruma::{EventId, RoomId};
|
||||
use tuwunel_core::{
|
||||
Result,
|
||||
arrayvec::ArrayVec,
|
||||
at, checked, err, expected, utils,
|
||||
utils::{bytes, math::usize_from_f64, stream::IterStream},
|
||||
};
|
||||
use database::Map;
|
||||
use futures::{Stream, StreamExt};
|
||||
use lru_cache::LruCache;
|
||||
use ruma::{EventId, RoomId};
|
||||
use tuwunel_database::Map;
|
||||
|
||||
use crate::{
|
||||
Dep, rooms,
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
use std::{collections::BTreeMap, sync::Arc};
|
||||
|
||||
use conduwuit::{
|
||||
use futures::{Stream, StreamExt};
|
||||
use ruma::{
|
||||
CanonicalJsonValue, EventId, OwnedUserId, RoomId, UserId,
|
||||
api::client::threads::get_threads::v1::IncludeThreads, events::relation::BundledThread, uint,
|
||||
};
|
||||
use serde_json::json;
|
||||
use tuwunel_core::{
|
||||
Result, err,
|
||||
matrix::pdu::{PduCount, PduEvent, PduId, RawPduId},
|
||||
utils::{
|
||||
@@ -8,13 +14,7 @@ use conduwuit::{
|
||||
stream::{TryIgnore, WidebandExt},
|
||||
},
|
||||
};
|
||||
use conduwuit_database::{Deserialized, Map};
|
||||
use futures::{Stream, StreamExt};
|
||||
use ruma::{
|
||||
CanonicalJsonValue, EventId, OwnedUserId, RoomId, UserId,
|
||||
api::client::threads::get_threads::v1::IncludeThreads, events::relation::BundledThread, uint,
|
||||
};
|
||||
use serde_json::json;
|
||||
use tuwunel_database::{Deserialized, Map};
|
||||
|
||||
use crate::{Dep, rooms, rooms::short::ShortRoomId};
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
use std::{borrow::Borrow, sync::Arc};
|
||||
|
||||
use conduwuit::{
|
||||
use futures::{FutureExt, Stream, TryFutureExt, TryStreamExt, future::select_ok, pin_mut};
|
||||
use ruma::{CanonicalJsonObject, EventId, OwnedUserId, RoomId, UserId, api::Direction};
|
||||
use tuwunel_core::{
|
||||
Err, PduCount, PduEvent, Result, at, err,
|
||||
result::{LogErr, NotFound},
|
||||
utils,
|
||||
utils::stream::TryReadyExt,
|
||||
};
|
||||
use database::{Database, Deserialized, Json, KeyVal, Map};
|
||||
use futures::{FutureExt, Stream, TryFutureExt, TryStreamExt, future::select_ok, pin_mut};
|
||||
use ruma::{CanonicalJsonObject, EventId, OwnedUserId, RoomId, UserId, api::Direction};
|
||||
use tuwunel_database::{Database, Deserialized, Json, KeyVal, Map};
|
||||
|
||||
use super::{PduId, RawPduId};
|
||||
use crate::{Dep, rooms, rooms::short::ShortRoomId};
|
||||
|
||||
@@ -10,19 +10,6 @@ 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,
|
||||
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,
|
||||
};
|
||||
use futures::{
|
||||
Future, FutureExt, Stream, StreamExt, TryStreamExt, future, future::ready, pin_mut,
|
||||
};
|
||||
@@ -47,6 +34,19 @@ use ruma::{
|
||||
};
|
||||
use serde::Deserialize;
|
||||
use serde_json::value::{RawValue as RawJsonValue, to_raw_value};
|
||||
pub use tuwunel_core::matrix::pdu::{PduId, RawPduId};
|
||||
use tuwunel_core::{
|
||||
Err, Error, Result, Server, at, debug, debug_warn, err, error, implement, info,
|
||||
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,
|
||||
};
|
||||
|
||||
use self::data::Data;
|
||||
pub use self::data::PdusIterItem;
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
use std::{collections::BTreeMap, sync::Arc};
|
||||
|
||||
use conduwuit::{
|
||||
Result, Server, debug_info, trace,
|
||||
utils::{self, IterStream},
|
||||
};
|
||||
use futures::StreamExt;
|
||||
use ruma::{
|
||||
OwnedRoomId, OwnedUserId, RoomId, UserId,
|
||||
@@ -11,6 +7,10 @@ use ruma::{
|
||||
events::SyncEphemeralRoomEvent,
|
||||
};
|
||||
use tokio::sync::{RwLock, broadcast};
|
||||
use tuwunel_core::{
|
||||
Result, Server, debug_info, trace,
|
||||
utils::{self, IterStream},
|
||||
};
|
||||
|
||||
use crate::{Dep, globals, sending, sending::EduBuf, users};
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use conduwuit::{Result, implement};
|
||||
use database::{Database, Deserialized, Map};
|
||||
use ruma::{RoomId, UserId};
|
||||
use tuwunel_core::{Result, implement};
|
||||
use tuwunel_database::{Database, Deserialized, Map};
|
||||
|
||||
use crate::{Dep, globals, rooms, rooms::short::ShortStateHash};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user