@@ -2,14 +2,6 @@ use std::fmt::Write;
|
||||
|
||||
use axum::extract::State;
|
||||
use axum_client_ip::InsecureClientIp;
|
||||
use conduwuit::{
|
||||
Err, Error, Result, debug_info, err, error, info, is_equal_to,
|
||||
matrix::pdu::PduBuilder,
|
||||
utils,
|
||||
utils::{ReadyExt, stream::BroadbandExt},
|
||||
warn,
|
||||
};
|
||||
use conduwuit_service::Services;
|
||||
use futures::{FutureExt, StreamExt};
|
||||
use register::RegistrationKind;
|
||||
use ruma::{
|
||||
@@ -33,6 +25,14 @@ use ruma::{
|
||||
},
|
||||
push,
|
||||
};
|
||||
use tuwunel_core::{
|
||||
Err, Error, Result, debug_info, err, error, info, is_equal_to,
|
||||
matrix::pdu::PduBuilder,
|
||||
utils,
|
||||
utils::{ReadyExt, stream::BroadbandExt},
|
||||
warn,
|
||||
};
|
||||
use tuwunel_service::Services;
|
||||
|
||||
use super::{DEVICE_ID_LENGTH, SESSION_ID_LENGTH, TOKEN_LENGTH, join_room_by_id_helper};
|
||||
use crate::Ruma;
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
use axum::extract::State;
|
||||
use conduwuit::{Err, Result, err};
|
||||
use conduwuit_service::Services;
|
||||
use ruma::{
|
||||
RoomId, UserId,
|
||||
api::client::config::{
|
||||
@@ -15,6 +13,8 @@ use ruma::{
|
||||
};
|
||||
use serde::Deserialize;
|
||||
use serde_json::{json, value::RawValue as RawJsonValue};
|
||||
use tuwunel_core::{Err, Result, err};
|
||||
use tuwunel_service::Services;
|
||||
|
||||
use crate::Ruma;
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
use axum::extract::State;
|
||||
use conduwuit::{Err, Result, debug};
|
||||
use conduwuit_service::Services;
|
||||
use futures::StreamExt;
|
||||
use rand::seq::SliceRandom;
|
||||
use ruma::{
|
||||
OwnedServerName, RoomAliasId, RoomId,
|
||||
api::client::alias::{create_alias, delete_alias, get_alias},
|
||||
};
|
||||
use tuwunel_core::{Err, Result, debug};
|
||||
use tuwunel_service::Services;
|
||||
|
||||
use crate::Ruma;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use axum::extract::State;
|
||||
use conduwuit::{Err, Result, err};
|
||||
use ruma::api::{appservice::ping, client::appservice::request_ping};
|
||||
use tuwunel_core::{Err, Result, err};
|
||||
|
||||
use crate::Ruma;
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
use std::cmp::Ordering;
|
||||
|
||||
use axum::extract::State;
|
||||
use conduwuit::{Err, Result, err};
|
||||
use ruma::{
|
||||
UInt,
|
||||
api::client::backup::{
|
||||
@@ -12,6 +11,7 @@ use ruma::{
|
||||
update_backup_version,
|
||||
},
|
||||
};
|
||||
use tuwunel_core::{Err, Result, err};
|
||||
|
||||
use crate::Ruma;
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
use axum::extract::State;
|
||||
use conduwuit::{Result, Server};
|
||||
use ruma::{
|
||||
RoomVersionId,
|
||||
api::client::discovery::get_capabilities::{
|
||||
@@ -10,6 +9,7 @@ use ruma::{
|
||||
},
|
||||
};
|
||||
use serde_json::json;
|
||||
use tuwunel_core::{Result, Server};
|
||||
|
||||
use crate::Ruma;
|
||||
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
use axum::extract::State;
|
||||
use conduwuit::{
|
||||
use futures::{
|
||||
FutureExt, StreamExt, TryFutureExt, TryStreamExt,
|
||||
future::{OptionFuture, join, join3, try_join3},
|
||||
};
|
||||
use ruma::{OwnedEventId, UserId, api::client::context::get_context, events::StateEventType};
|
||||
use tuwunel_core::{
|
||||
Err, Result, at, debug_warn, err,
|
||||
matrix::pdu::PduEvent,
|
||||
ref_at,
|
||||
@@ -9,12 +14,7 @@ use conduwuit::{
|
||||
stream::{BroadbandExt, ReadyExt, TryIgnore, WidebandExt},
|
||||
},
|
||||
};
|
||||
use conduwuit_service::rooms::{lazy_loading, lazy_loading::Options, short::ShortStateKey};
|
||||
use futures::{
|
||||
FutureExt, StreamExt, TryFutureExt, TryStreamExt,
|
||||
future::{OptionFuture, join, join3, try_join3},
|
||||
};
|
||||
use ruma::{OwnedEventId, UserId, api::client::context::get_context, events::StateEventType};
|
||||
use tuwunel_service::rooms::{lazy_loading, lazy_loading::Options, short::ShortStateKey};
|
||||
|
||||
use crate::{
|
||||
Ruma,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
use axum::extract::State;
|
||||
use axum_client_ip::InsecureClientIp;
|
||||
use conduwuit::{Err, Error, Result, debug, err, utils};
|
||||
use futures::StreamExt;
|
||||
use ruma::{
|
||||
MilliSecondsSinceUnixEpoch, OwnedDeviceId,
|
||||
@@ -10,6 +9,7 @@ use ruma::{
|
||||
uiaa::{AuthFlow, AuthType, UiaaInfo},
|
||||
},
|
||||
};
|
||||
use tuwunel_core::{Err, Error, Result, debug, err, utils};
|
||||
|
||||
use super::SESSION_ID_LENGTH;
|
||||
use crate::{Ruma, client::DEVICE_ID_LENGTH};
|
||||
|
||||
@@ -1,15 +1,5 @@
|
||||
use axum::extract::State;
|
||||
use axum_client_ip::InsecureClientIp;
|
||||
use conduwuit::{
|
||||
Err, Result, err, info,
|
||||
utils::{
|
||||
TryFutureExtExt,
|
||||
math::Expected,
|
||||
result::FlatOk,
|
||||
stream::{ReadyExt, WidebandExt},
|
||||
},
|
||||
};
|
||||
use conduwuit_service::Services;
|
||||
use futures::{
|
||||
FutureExt, StreamExt, TryFutureExt,
|
||||
future::{join, join4, join5},
|
||||
@@ -36,6 +26,16 @@ use ruma::{
|
||||
},
|
||||
uint,
|
||||
};
|
||||
use tuwunel_core::{
|
||||
Err, Result, err, info,
|
||||
utils::{
|
||||
TryFutureExtExt,
|
||||
math::Expected,
|
||||
result::FlatOk,
|
||||
stream::{ReadyExt, WidebandExt},
|
||||
},
|
||||
};
|
||||
use tuwunel_service::Services;
|
||||
|
||||
use crate::Ruma;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use axum::extract::State;
|
||||
use conduwuit::{Result, err};
|
||||
use ruma::api::client::filter::{create_filter, get_filter};
|
||||
use tuwunel_core::{Result, err};
|
||||
|
||||
use crate::Ruma;
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
use std::collections::{BTreeMap, HashMap, HashSet};
|
||||
|
||||
use axum::extract::State;
|
||||
use conduwuit::{Err, Error, Result, debug, debug_warn, err, result::NotFound, utils};
|
||||
use conduwuit_service::{Services, users::parse_master_key};
|
||||
use futures::{StreamExt, stream::FuturesUnordered};
|
||||
use ruma::{
|
||||
OneTimeKeyAlgorithm, OwnedDeviceId, OwnedUserId, UserId,
|
||||
@@ -22,6 +20,8 @@ use ruma::{
|
||||
serde::Raw,
|
||||
};
|
||||
use serde_json::json;
|
||||
use tuwunel_core::{Err, Error, Result, debug, debug_warn, err, result::NotFound, utils};
|
||||
use tuwunel_service::{Services, users::parse_master_key};
|
||||
|
||||
use super::SESSION_ID_LENGTH;
|
||||
use crate::Ruma;
|
||||
|
||||
@@ -2,14 +2,6 @@ use std::time::Duration;
|
||||
|
||||
use axum::extract::State;
|
||||
use axum_client_ip::InsecureClientIp;
|
||||
use conduwuit::{
|
||||
Err, Result, err,
|
||||
utils::{self, content_disposition::make_content_disposition, math::ruma_from_usize},
|
||||
};
|
||||
use conduwuit_service::{
|
||||
Services,
|
||||
media::{CACHE_CONTROL_IMMUTABLE, CORP_CROSS_ORIGIN, Dim, FileMeta, MXC_LENGTH},
|
||||
};
|
||||
use reqwest::Url;
|
||||
use ruma::{
|
||||
Mxc, UserId,
|
||||
@@ -21,6 +13,14 @@ use ruma::{
|
||||
media::create_content,
|
||||
},
|
||||
};
|
||||
use tuwunel_core::{
|
||||
Err, Result, err,
|
||||
utils::{self, content_disposition::make_content_disposition, math::ruma_from_usize},
|
||||
};
|
||||
use tuwunel_service::{
|
||||
Services,
|
||||
media::{CACHE_CONTROL_IMMUTABLE, CORP_CROSS_ORIGIN, Dim, FileMeta, MXC_LENGTH},
|
||||
};
|
||||
|
||||
use crate::Ruma;
|
||||
|
||||
|
||||
@@ -2,11 +2,6 @@
|
||||
|
||||
use axum::extract::State;
|
||||
use axum_client_ip::InsecureClientIp;
|
||||
use conduwuit::{
|
||||
Err, Result, err,
|
||||
utils::{content_disposition::make_content_disposition, math::ruma_from_usize},
|
||||
};
|
||||
use conduwuit_service::media::{CACHE_CONTROL_IMMUTABLE, CORP_CROSS_ORIGIN, Dim, FileMeta};
|
||||
use reqwest::Url;
|
||||
use ruma::{
|
||||
Mxc,
|
||||
@@ -15,6 +10,11 @@ use ruma::{
|
||||
get_media_config, get_media_preview,
|
||||
},
|
||||
};
|
||||
use tuwunel_core::{
|
||||
Err, Result, err,
|
||||
utils::{content_disposition::make_content_disposition, math::ruma_from_usize},
|
||||
};
|
||||
use tuwunel_service::media::{CACHE_CONTROL_IMMUTABLE, CORP_CROSS_ORIGIN, Dim, FileMeta};
|
||||
|
||||
use crate::{Ruma, RumaResponse, client::create_content_route};
|
||||
|
||||
|
||||
@@ -8,31 +8,6 @@ use std::{
|
||||
|
||||
use axum::extract::State;
|
||||
use axum_client_ip::InsecureClientIp;
|
||||
use conduwuit::{
|
||||
Err, Result, at, debug, debug_error, debug_info, debug_warn, err, error, info, is_matching,
|
||||
matrix::{
|
||||
StateKey,
|
||||
pdu::{PduBuilder, PduEvent, gen_event_id, gen_event_id_canonical_json},
|
||||
state_res,
|
||||
},
|
||||
result::{FlatOk, NotFound},
|
||||
trace,
|
||||
utils::{
|
||||
self, FutureBoolExt,
|
||||
future::ReadyEqExt,
|
||||
shuffle,
|
||||
stream::{BroadbandExt, IterStream, ReadyExt},
|
||||
},
|
||||
warn,
|
||||
};
|
||||
use conduwuit_service::{
|
||||
Services,
|
||||
appservice::RegistrationInfo,
|
||||
rooms::{
|
||||
state::RoomMutexGuard,
|
||||
state_compressor::{CompressedState, HashSetCompressStateEvent},
|
||||
},
|
||||
};
|
||||
use futures::{FutureExt, StreamExt, TryFutureExt, join, pin_mut};
|
||||
use ruma::{
|
||||
CanonicalJsonObject, CanonicalJsonValue, OwnedEventId, OwnedRoomId, OwnedServerName,
|
||||
@@ -60,6 +35,31 @@ use ruma::{
|
||||
},
|
||||
},
|
||||
};
|
||||
use tuwunel_core::{
|
||||
Err, Result, at, debug, debug_error, debug_info, debug_warn, err, error, info, is_matching,
|
||||
matrix::{
|
||||
StateKey,
|
||||
pdu::{PduBuilder, PduEvent, gen_event_id, gen_event_id_canonical_json},
|
||||
state_res,
|
||||
},
|
||||
result::{FlatOk, NotFound},
|
||||
trace,
|
||||
utils::{
|
||||
self, FutureBoolExt,
|
||||
future::ReadyEqExt,
|
||||
shuffle,
|
||||
stream::{BroadbandExt, IterStream, ReadyExt},
|
||||
},
|
||||
warn,
|
||||
};
|
||||
use tuwunel_service::{
|
||||
Services,
|
||||
appservice::RegistrationInfo,
|
||||
rooms::{
|
||||
state::RoomMutexGuard,
|
||||
state_compressor::{CompressedState, HashSetCompressStateEvent},
|
||||
},
|
||||
};
|
||||
|
||||
use crate::{Ruma, client::full_user_deactivate};
|
||||
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
use axum::extract::State;
|
||||
use conduwuit::{
|
||||
use futures::{FutureExt, StreamExt, TryFutureExt, future::OptionFuture, pin_mut};
|
||||
use ruma::{
|
||||
RoomId, UserId,
|
||||
api::{
|
||||
Direction,
|
||||
client::{filter::RoomEventFilter, message::get_message_events},
|
||||
},
|
||||
events::{AnyStateEvent, StateEventType, TimelineEventType, TimelineEventType::*},
|
||||
serde::Raw,
|
||||
};
|
||||
use tuwunel_core::{
|
||||
Err, Result, at,
|
||||
matrix::{
|
||||
Event,
|
||||
@@ -11,7 +21,7 @@ use conduwuit::{
|
||||
stream::{BroadbandExt, TryIgnore, WidebandExt},
|
||||
},
|
||||
};
|
||||
use conduwuit_service::{
|
||||
use tuwunel_service::{
|
||||
Services,
|
||||
rooms::{
|
||||
lazy_loading,
|
||||
@@ -19,16 +29,6 @@ use conduwuit_service::{
|
||||
timeline::PdusIterItem,
|
||||
},
|
||||
};
|
||||
use futures::{FutureExt, StreamExt, TryFutureExt, future::OptionFuture, pin_mut};
|
||||
use ruma::{
|
||||
RoomId, UserId,
|
||||
api::{
|
||||
Direction,
|
||||
client::{filter::RoomEventFilter, message::get_message_events},
|
||||
},
|
||||
events::{AnyStateEvent, StateEventType, TimelineEventType, TimelineEventType::*},
|
||||
serde::Raw,
|
||||
};
|
||||
|
||||
use crate::Ruma;
|
||||
|
||||
@@ -296,7 +296,7 @@ pub(crate) fn event_filter(item: PdusIterItem, filter: &RoomEventFilter) -> Opti
|
||||
pdu.matches(filter).then_some(item)
|
||||
}
|
||||
|
||||
#[cfg_attr(debug_assertions, conduwuit::ctor)]
|
||||
#[cfg_attr(debug_assertions, tuwunel_core::ctor)]
|
||||
fn _is_sorted() {
|
||||
debug_assert!(
|
||||
IGNORED_MESSAGE_TYPES.is_sorted(),
|
||||
|
||||
@@ -90,4 +90,4 @@ const DEVICE_ID_LENGTH: usize = 10;
|
||||
const TOKEN_LENGTH: usize = 32;
|
||||
|
||||
/// generated user session ID length
|
||||
const SESSION_ID_LENGTH: usize = service::uiaa::SESSION_ID_LENGTH;
|
||||
const SESSION_ID_LENGTH: usize = tuwunel_service::uiaa::SESSION_ID_LENGTH;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
use std::time::Duration;
|
||||
|
||||
use axum::extract::State;
|
||||
use conduwuit::{Error, Result, utils};
|
||||
use ruma::{
|
||||
api::client::{account, error::ErrorKind},
|
||||
authentication::TokenType,
|
||||
};
|
||||
use tuwunel_core::{Error, Result, utils};
|
||||
|
||||
use super::TOKEN_LENGTH;
|
||||
use crate::Ruma;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use std::time::Duration;
|
||||
|
||||
use axum::extract::State;
|
||||
use conduwuit::{Err, Result};
|
||||
use ruma::api::client::presence::{get_presence, set_presence};
|
||||
use tuwunel_core::{Err, Result};
|
||||
|
||||
use crate::Ruma;
|
||||
|
||||
|
||||
@@ -1,13 +1,6 @@
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
use axum::extract::State;
|
||||
use conduwuit::{
|
||||
Err, Error, Result,
|
||||
matrix::pdu::PduBuilder,
|
||||
utils::{IterStream, stream::TryIgnore},
|
||||
warn,
|
||||
};
|
||||
use conduwuit_service::Services;
|
||||
use futures::{StreamExt, TryStreamExt, future::join3};
|
||||
use ruma::{
|
||||
OwnedMxcUri, OwnedRoomId, UserId,
|
||||
@@ -23,6 +16,13 @@ use ruma::{
|
||||
events::room::member::{MembershipState, RoomMemberEventContent},
|
||||
presence::PresenceState,
|
||||
};
|
||||
use tuwunel_core::{
|
||||
Err, Error, Result,
|
||||
matrix::pdu::PduBuilder,
|
||||
utils::{IterStream, stream::TryIgnore},
|
||||
warn,
|
||||
};
|
||||
use tuwunel_service::Services;
|
||||
|
||||
use crate::Ruma;
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
use axum::extract::State;
|
||||
use conduwuit::{Err, Error, Result, err};
|
||||
use conduwuit_service::Services;
|
||||
use ruma::{
|
||||
CanonicalJsonObject, CanonicalJsonValue,
|
||||
api::client::{
|
||||
@@ -20,6 +18,8 @@ use ruma::{
|
||||
RemovePushRuleError, Ruleset,
|
||||
},
|
||||
};
|
||||
use tuwunel_core::{Err, Error, Result, err};
|
||||
use tuwunel_service::Services;
|
||||
|
||||
use crate::Ruma;
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
use axum::extract::State;
|
||||
use conduwuit::{Err, PduCount, Result, err};
|
||||
use ruma::{
|
||||
MilliSecondsSinceUnixEpoch,
|
||||
api::client::{read_marker::set_read_marker, receipt::create_receipt},
|
||||
@@ -10,6 +9,7 @@ use ruma::{
|
||||
receipt::{ReceiptThread, ReceiptType},
|
||||
},
|
||||
};
|
||||
use tuwunel_core::{Err, PduCount, Result, err};
|
||||
|
||||
use crate::Ruma;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use axum::extract::State;
|
||||
use conduwuit::{Result, matrix::pdu::PduBuilder};
|
||||
use ruma::{
|
||||
api::client::redact::redact_event, events::room::redaction::RoomRedactionEventContent,
|
||||
};
|
||||
use tuwunel_core::{Result, matrix::pdu::PduBuilder};
|
||||
|
||||
use crate::Ruma;
|
||||
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
use axum::extract::State;
|
||||
use conduwuit::{
|
||||
Result, at,
|
||||
matrix::pdu::PduCount,
|
||||
utils::{IterStream, ReadyExt, result::FlatOk, stream::WidebandExt},
|
||||
};
|
||||
use conduwuit_service::{Services, rooms::timeline::PdusIterItem};
|
||||
use futures::StreamExt;
|
||||
use ruma::{
|
||||
EventId, RoomId, UInt, UserId,
|
||||
@@ -17,6 +11,12 @@ use ruma::{
|
||||
},
|
||||
events::{TimelineEventType, relation::RelationType},
|
||||
};
|
||||
use tuwunel_core::{
|
||||
Result, at,
|
||||
matrix::pdu::PduCount,
|
||||
utils::{IterStream, ReadyExt, result::FlatOk, stream::WidebandExt},
|
||||
};
|
||||
use tuwunel_service::{Services, rooms::timeline::PdusIterItem};
|
||||
|
||||
use crate::Ruma;
|
||||
|
||||
|
||||
@@ -2,8 +2,6 @@ use std::time::Duration;
|
||||
|
||||
use axum::extract::State;
|
||||
use axum_client_ip::InsecureClientIp;
|
||||
use conduwuit::{Err, Error, Result, debug_info, info, matrix::pdu::PduEvent, utils::ReadyExt};
|
||||
use conduwuit_service::Services;
|
||||
use rand::Rng;
|
||||
use ruma::{
|
||||
EventId, RoomId, UserId,
|
||||
@@ -15,6 +13,10 @@ use ruma::{
|
||||
int,
|
||||
};
|
||||
use tokio::time::sleep;
|
||||
use tuwunel_core::{
|
||||
Err, Error, Result, debug_info, info, matrix::pdu::PduEvent, utils::ReadyExt,
|
||||
};
|
||||
use tuwunel_service::Services;
|
||||
|
||||
use crate::Ruma;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use axum::extract::State;
|
||||
use conduwuit::{Error, Result};
|
||||
use futures::StreamExt;
|
||||
use ruma::api::client::{error::ErrorKind, room::aliases};
|
||||
use tuwunel_core::{Error, Result};
|
||||
|
||||
use crate::Ruma;
|
||||
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
use axum::extract::State;
|
||||
use conduwuit::{
|
||||
Err, Error, Result, debug_info, debug_warn, err, error, info,
|
||||
matrix::{StateKey, pdu::PduBuilder},
|
||||
warn,
|
||||
};
|
||||
use conduwuit_service::{Services, appservice::RegistrationInfo};
|
||||
use futures::FutureExt;
|
||||
use ruma::{
|
||||
CanonicalJsonObject, Int, OwnedRoomAliasId, OwnedRoomId, OwnedUserId, RoomId, RoomVersionId,
|
||||
@@ -32,6 +26,12 @@ use ruma::{
|
||||
serde::{JsonObject, Raw},
|
||||
};
|
||||
use serde_json::{json, value::to_raw_value};
|
||||
use tuwunel_core::{
|
||||
Err, Error, Result, debug_info, debug_warn, err, error, info,
|
||||
matrix::{StateKey, pdu::PduBuilder},
|
||||
warn,
|
||||
};
|
||||
use tuwunel_service::{Services, appservice::RegistrationInfo};
|
||||
|
||||
use crate::{Ruma, client::invite_helper};
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use axum::extract::State;
|
||||
use conduwuit::{Err, Event, Result, err};
|
||||
use futures::{FutureExt, TryFutureExt, future::try_join};
|
||||
use ruma::api::client::room::get_room_event;
|
||||
use tuwunel_core::{Err, Event, Result, err};
|
||||
|
||||
use crate::{Ruma, client::is_ignored_pdu};
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
use axum::extract::State;
|
||||
use conduwuit::{
|
||||
use futures::TryStreamExt;
|
||||
use ruma::api::client::room::initial_sync::v3::{PaginationChunk, Request, Response};
|
||||
use tuwunel_core::{
|
||||
Err, PduEvent, Result, at,
|
||||
utils::{BoolExt, stream::TryTools},
|
||||
};
|
||||
use futures::TryStreamExt;
|
||||
use ruma::api::client::room::initial_sync::v3::{PaginationChunk, Request, Response};
|
||||
|
||||
use crate::Ruma;
|
||||
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
use axum::extract::State;
|
||||
use axum_client_ip::InsecureClientIp;
|
||||
use conduwuit::{
|
||||
Err, Result, debug_warn, trace,
|
||||
utils::{IterStream, future::TryExtExt},
|
||||
};
|
||||
use futures::{
|
||||
FutureExt, StreamExt,
|
||||
future::{OptionFuture, join3},
|
||||
@@ -18,7 +14,11 @@ use ruma::{
|
||||
events::room::member::MembershipState,
|
||||
space::SpaceRoomJoinRule::{self, *},
|
||||
};
|
||||
use service::Services;
|
||||
use tuwunel_core::{
|
||||
Err, Result, debug_warn, trace,
|
||||
utils::{IterStream, future::TryExtExt},
|
||||
};
|
||||
use tuwunel_service::Services;
|
||||
|
||||
use crate::{Ruma, RumaResponse};
|
||||
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
use std::cmp::max;
|
||||
|
||||
use axum::extract::State;
|
||||
use conduwuit::{
|
||||
Error, Result, err, info,
|
||||
matrix::{StateKey, pdu::PduBuilder},
|
||||
};
|
||||
use futures::StreamExt;
|
||||
use ruma::{
|
||||
CanonicalJsonObject, RoomId, RoomVersionId,
|
||||
@@ -20,6 +16,10 @@ use ruma::{
|
||||
int,
|
||||
};
|
||||
use serde_json::{json, value::to_raw_value};
|
||||
use tuwunel_core::{
|
||||
Error, Result, err, info,
|
||||
matrix::{StateKey, pdu::PduBuilder},
|
||||
};
|
||||
|
||||
use crate::Ruma;
|
||||
|
||||
|
||||
@@ -1,13 +1,6 @@
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
use axum::extract::State;
|
||||
use conduwuit::{
|
||||
Err, Result, at, is_true,
|
||||
matrix::pdu::PduEvent,
|
||||
result::FlatOk,
|
||||
utils::{IterStream, stream::ReadyExt},
|
||||
};
|
||||
use conduwuit_service::{Services, rooms::search::RoomQuery};
|
||||
use futures::{FutureExt, StreamExt, TryFutureExt, TryStreamExt, future::OptionFuture};
|
||||
use ruma::{
|
||||
OwnedRoomId, RoomId, UInt, UserId,
|
||||
@@ -19,6 +12,13 @@ use ruma::{
|
||||
serde::Raw,
|
||||
};
|
||||
use search_events::v3::{Request, Response};
|
||||
use tuwunel_core::{
|
||||
Err, Result, at, is_true,
|
||||
matrix::pdu::PduEvent,
|
||||
result::FlatOk,
|
||||
utils::{IterStream, stream::ReadyExt},
|
||||
};
|
||||
use tuwunel_service::{Services, rooms::search::RoomQuery};
|
||||
|
||||
use crate::Ruma;
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
use axum::extract::State;
|
||||
use conduwuit::{Err, Result, err, matrix::pdu::PduBuilder, utils};
|
||||
use ruma::{api::client::message::send_message_event, events::MessageLikeEventType};
|
||||
use serde_json::from_str;
|
||||
use tuwunel_core::{Err, Result, err, matrix::pdu::PduBuilder, utils};
|
||||
|
||||
use crate::Ruma;
|
||||
|
||||
|
||||
@@ -2,11 +2,6 @@ use std::time::Duration;
|
||||
|
||||
use axum::extract::State;
|
||||
use axum_client_ip::InsecureClientIp;
|
||||
use conduwuit::{
|
||||
Err, Error, Result, debug, err, info, utils,
|
||||
utils::{ReadyExt, hash},
|
||||
};
|
||||
use conduwuit_service::uiaa::SESSION_ID_LENGTH;
|
||||
use futures::StreamExt;
|
||||
use ruma::{
|
||||
UserId,
|
||||
@@ -26,6 +21,11 @@ use ruma::{
|
||||
uiaa,
|
||||
},
|
||||
};
|
||||
use tuwunel_core::{
|
||||
Err, Error, Result, debug, err, info, utils,
|
||||
utils::{ReadyExt, hash},
|
||||
};
|
||||
use tuwunel_service::uiaa::SESSION_ID_LENGTH;
|
||||
|
||||
use super::{DEVICE_ID_LENGTH, TOKEN_LENGTH};
|
||||
use crate::Ruma;
|
||||
|
||||
@@ -4,20 +4,20 @@ use std::{
|
||||
};
|
||||
|
||||
use axum::extract::State;
|
||||
use conduwuit::{
|
||||
use futures::{StreamExt, TryFutureExt, future::OptionFuture};
|
||||
use ruma::{
|
||||
OwnedRoomId, OwnedServerName, RoomId, UInt, UserId, api::client::space::get_hierarchy,
|
||||
};
|
||||
use tuwunel_core::{
|
||||
Err, Result,
|
||||
utils::{future::TryExtExt, stream::IterStream},
|
||||
};
|
||||
use conduwuit_service::{
|
||||
use tuwunel_service::{
|
||||
Services,
|
||||
rooms::spaces::{
|
||||
PaginationToken, SummaryAccessibility, get_parent_children_via, summary_to_chunk,
|
||||
},
|
||||
};
|
||||
use futures::{StreamExt, TryFutureExt, future::OptionFuture};
|
||||
use ruma::{
|
||||
OwnedRoomId, OwnedServerName, RoomId, UInt, UserId, api::client::space::get_hierarchy,
|
||||
};
|
||||
|
||||
use crate::Ruma;
|
||||
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
use axum::extract::State;
|
||||
use conduwuit::{
|
||||
Err, Result, err,
|
||||
matrix::pdu::{PduBuilder, PduEvent},
|
||||
utils::BoolExt,
|
||||
};
|
||||
use conduwuit_service::Services;
|
||||
use futures::TryStreamExt;
|
||||
use ruma::{
|
||||
OwnedEventId, RoomId, UserId,
|
||||
@@ -21,6 +15,12 @@ use ruma::{
|
||||
},
|
||||
serde::Raw,
|
||||
};
|
||||
use tuwunel_core::{
|
||||
Err, Result, err,
|
||||
matrix::pdu::{PduBuilder, PduEvent},
|
||||
utils::BoolExt,
|
||||
};
|
||||
use tuwunel_service::Services;
|
||||
|
||||
use crate::{Ruma, RumaResponse};
|
||||
|
||||
|
||||
@@ -2,12 +2,6 @@ mod v3;
|
||||
mod v4;
|
||||
mod v5;
|
||||
|
||||
use conduwuit::{
|
||||
Error, PduCount, Result,
|
||||
matrix::pdu::PduEvent,
|
||||
utils::stream::{BroadbandExt, ReadyExt, TryIgnore},
|
||||
};
|
||||
use conduwuit_service::Services;
|
||||
use futures::{StreamExt, pin_mut};
|
||||
use ruma::{
|
||||
RoomId, UserId,
|
||||
@@ -15,6 +9,12 @@ use ruma::{
|
||||
self, Beacon, CallInvite, PollStart, RoomEncrypted, RoomMessage, Sticker,
|
||||
},
|
||||
};
|
||||
use tuwunel_core::{
|
||||
Error, PduCount, Result,
|
||||
matrix::pdu::PduEvent,
|
||||
utils::stream::{BroadbandExt, ReadyExt, TryIgnore},
|
||||
};
|
||||
use tuwunel_service::Services;
|
||||
|
||||
pub(crate) use self::{
|
||||
v3::sync_events_route, v4::sync_events_v4_route, v5::sync_events_v5_route,
|
||||
|
||||
@@ -5,30 +5,6 @@ use std::{
|
||||
};
|
||||
|
||||
use axum::extract::State;
|
||||
use conduwuit::{
|
||||
Result, at, err, error, extract_variant, is_equal_to,
|
||||
matrix::{
|
||||
Event,
|
||||
pdu::{EventHash, PduCount, PduEvent},
|
||||
},
|
||||
pair_of, ref_at,
|
||||
result::FlatOk,
|
||||
utils::{
|
||||
self, BoolExt, FutureBoolExt, IterStream, ReadyExt, TryFutureExtExt,
|
||||
future::{OptionStream, ReadyEqExt},
|
||||
math::ruma_from_u64,
|
||||
stream::{BroadbandExt, Tools, TryExpect, WidebandExt},
|
||||
},
|
||||
warn,
|
||||
};
|
||||
use conduwuit_service::{
|
||||
Services,
|
||||
rooms::{
|
||||
lazy_loading,
|
||||
lazy_loading::{Options, Witness},
|
||||
short::ShortStateHash,
|
||||
},
|
||||
};
|
||||
use futures::{
|
||||
FutureExt, StreamExt, TryFutureExt, TryStreamExt,
|
||||
future::{OptionFuture, join, join3, join4, join5, try_join, try_join4},
|
||||
@@ -57,7 +33,30 @@ use ruma::{
|
||||
serde::Raw,
|
||||
uint,
|
||||
};
|
||||
use service::rooms::short::{ShortEventId, ShortStateKey};
|
||||
use tuwunel_core::{
|
||||
Result, at, err, error, extract_variant, is_equal_to,
|
||||
matrix::{
|
||||
Event,
|
||||
pdu::{EventHash, PduCount, PduEvent},
|
||||
},
|
||||
pair_of, ref_at,
|
||||
result::FlatOk,
|
||||
utils::{
|
||||
self, BoolExt, FutureBoolExt, IterStream, ReadyExt, TryFutureExtExt,
|
||||
future::{OptionStream, ReadyEqExt},
|
||||
math::ruma_from_u64,
|
||||
stream::{BroadbandExt, Tools, TryExpect, WidebandExt},
|
||||
},
|
||||
warn,
|
||||
};
|
||||
use tuwunel_service::{
|
||||
Services,
|
||||
rooms::{
|
||||
lazy_loading,
|
||||
lazy_loading::{Options, Witness},
|
||||
short::{ShortEventId, ShortStateHash, ShortStateKey},
|
||||
},
|
||||
};
|
||||
|
||||
use super::{load_timeline, share_encrypted_room};
|
||||
use crate::{Ruma, RumaResponse, client::ignored_filter};
|
||||
|
||||
@@ -5,20 +5,6 @@ use std::{
|
||||
};
|
||||
|
||||
use axum::extract::State;
|
||||
use conduwuit::{
|
||||
Err, Error, PduCount, PduEvent, Result, debug, error, extract_variant,
|
||||
matrix::TypeStateKey,
|
||||
utils::{
|
||||
BoolExt, IterStream, ReadyExt, TryFutureExtExt,
|
||||
math::{ruma_from_usize, usize_from_ruma, usize_from_u64_truncated},
|
||||
},
|
||||
warn,
|
||||
};
|
||||
use conduwuit_service::{
|
||||
Services,
|
||||
rooms::read_receipt::pack_receipts,
|
||||
sync::{into_db_key, into_snake_key},
|
||||
};
|
||||
use futures::{FutureExt, StreamExt, TryFutureExt};
|
||||
use ruma::{
|
||||
MilliSecondsSinceUnixEpoch, OwnedEventId, OwnedRoomId, RoomId, UInt, UserId,
|
||||
@@ -35,6 +21,20 @@ use ruma::{
|
||||
serde::Raw,
|
||||
uint,
|
||||
};
|
||||
use tuwunel_core::{
|
||||
Err, Error, PduCount, PduEvent, Result, debug, error, extract_variant,
|
||||
matrix::TypeStateKey,
|
||||
utils::{
|
||||
BoolExt, IterStream, ReadyExt, TryFutureExtExt,
|
||||
math::{ruma_from_usize, usize_from_ruma, usize_from_u64_truncated},
|
||||
},
|
||||
warn,
|
||||
};
|
||||
use tuwunel_service::{
|
||||
Services,
|
||||
rooms::read_receipt::pack_receipts,
|
||||
sync::{into_db_key, into_snake_key},
|
||||
};
|
||||
|
||||
use super::{load_timeline, share_encrypted_room};
|
||||
use crate::{
|
||||
|
||||
@@ -6,21 +6,6 @@ use std::{
|
||||
};
|
||||
|
||||
use axum::extract::State;
|
||||
use conduwuit::{
|
||||
Err, Error, Result, error, extract_variant, is_equal_to,
|
||||
matrix::{
|
||||
TypeStateKey,
|
||||
pdu::{PduCount, PduEvent},
|
||||
},
|
||||
trace,
|
||||
utils::{
|
||||
BoolExt, FutureBoolExt, IterStream, ReadyExt, TryFutureExtExt,
|
||||
future::ReadyEqExt,
|
||||
math::{ruma_from_usize, usize_from_ruma},
|
||||
},
|
||||
warn,
|
||||
};
|
||||
use conduwuit_service::{Services, rooms::read_receipt::pack_receipts, sync::into_snake_key};
|
||||
use futures::{
|
||||
FutureExt, Stream, StreamExt, TryFutureExt,
|
||||
future::{OptionFuture, join3, try_join4},
|
||||
@@ -37,6 +22,21 @@ use ruma::{
|
||||
serde::Raw,
|
||||
uint,
|
||||
};
|
||||
use tuwunel_core::{
|
||||
Err, Error, Result, error, extract_variant, is_equal_to,
|
||||
matrix::{
|
||||
TypeStateKey,
|
||||
pdu::{PduCount, PduEvent},
|
||||
},
|
||||
trace,
|
||||
utils::{
|
||||
BoolExt, FutureBoolExt, IterStream, ReadyExt, TryFutureExtExt,
|
||||
future::ReadyEqExt,
|
||||
math::{ruma_from_usize, usize_from_ruma},
|
||||
},
|
||||
warn,
|
||||
};
|
||||
use tuwunel_service::{Services, rooms::read_receipt::pack_receipts, sync::into_snake_key};
|
||||
|
||||
use super::share_encrypted_room;
|
||||
use crate::{
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
use axum::extract::State;
|
||||
use conduwuit::Result;
|
||||
use ruma::{
|
||||
api::client::tag::{create_tag, delete_tag, get_tags},
|
||||
events::{
|
||||
@@ -9,6 +8,7 @@ use ruma::{
|
||||
tag::{TagEvent, TagEventContent},
|
||||
},
|
||||
};
|
||||
use tuwunel_core::Result;
|
||||
|
||||
use crate::Ruma;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
use conduwuit::Result;
|
||||
use ruma::api::client::thirdparty::get_protocols;
|
||||
use tuwunel_core::Result;
|
||||
|
||||
use crate::{Ruma, RumaResponse};
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
use axum::extract::State;
|
||||
use conduwuit::{
|
||||
use futures::StreamExt;
|
||||
use ruma::{api::client::threads::get_threads, uint};
|
||||
use tuwunel_core::{
|
||||
Result, at,
|
||||
matrix::pdu::{PduCount, PduEvent},
|
||||
};
|
||||
use futures::StreamExt;
|
||||
use ruma::{api::client::threads::get_threads, uint};
|
||||
|
||||
use crate::Ruma;
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
use axum::extract::State;
|
||||
use conduwuit::{Error, Result};
|
||||
use conduwuit_service::sending::EduBuf;
|
||||
use futures::StreamExt;
|
||||
use ruma::{
|
||||
api::{
|
||||
@@ -11,6 +9,8 @@ use ruma::{
|
||||
},
|
||||
to_device::DeviceIdOrAllDevices,
|
||||
};
|
||||
use tuwunel_core::{Error, Result};
|
||||
use tuwunel_service::sending::EduBuf;
|
||||
|
||||
use crate::Ruma;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use axum::extract::State;
|
||||
use conduwuit::{Err, Result, utils, utils::math::Tried};
|
||||
use ruma::api::client::typing::create_typing_event;
|
||||
use tuwunel_core::{Err, Result, utils, utils::math::Tried};
|
||||
|
||||
use crate::Ruma;
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ use std::collections::BTreeMap;
|
||||
|
||||
use axum::extract::State;
|
||||
use axum_client_ip::InsecureClientIp;
|
||||
use conduwuit::{Err, Error, Result};
|
||||
use futures::StreamExt;
|
||||
use ruma::{
|
||||
OwnedRoomId,
|
||||
@@ -19,6 +18,7 @@ use ruma::{
|
||||
},
|
||||
presence::PresenceState,
|
||||
};
|
||||
use tuwunel_core::{Err, Error, Result};
|
||||
|
||||
use super::{update_avatar_url, update_displayname};
|
||||
use crate::Ruma;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
use axum::{Json, extract::State, response::IntoResponse};
|
||||
use conduwuit::Result;
|
||||
use futures::StreamExt;
|
||||
use ruma::api::client::discovery::get_supported_versions;
|
||||
use tuwunel_core::Result;
|
||||
|
||||
use crate::Ruma;
|
||||
|
||||
@@ -60,23 +60,23 @@ pub(crate) async fn get_supported_versions_route(
|
||||
Ok(resp)
|
||||
}
|
||||
|
||||
/// # `GET /_conduwuit/server_version`
|
||||
/// # `GET /_tuwunel/server_version`
|
||||
///
|
||||
/// Conduwuit-specific API to get the server version, results akin to
|
||||
/// Tuwunel-specific API to get the server version, results akin to
|
||||
/// `/_matrix/federation/v1/version`
|
||||
pub(crate) async fn conduwuit_server_version() -> Result<impl IntoResponse> {
|
||||
pub(crate) async fn tuwunel_server_version() -> Result<impl IntoResponse> {
|
||||
Ok(Json(serde_json::json!({
|
||||
"name": conduwuit::version::name(),
|
||||
"version": conduwuit::version::version(),
|
||||
"name": tuwunel_core::version::name(),
|
||||
"version": tuwunel_core::version::version(),
|
||||
})))
|
||||
}
|
||||
|
||||
/// # `GET /_conduwuit/local_user_count`
|
||||
/// # `GET /_tuwunel/local_user_count`
|
||||
///
|
||||
/// conduwuit-specific API to return the amount of users registered on this
|
||||
/// Tuwunel-specific API to return the amount of users registered on this
|
||||
/// homeserver. Endpoint is disabled if federation is disabled for privacy. This
|
||||
/// only includes active users (not deactivated, no guests, etc)
|
||||
pub(crate) async fn conduwuit_local_user_count(
|
||||
pub(crate) async fn tuwunel_local_user_count(
|
||||
State(services): State<crate::State>,
|
||||
) -> Result<impl IntoResponse> {
|
||||
let user_count = services.users.list_local_users().count().await;
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
use axum::extract::State;
|
||||
use conduwuit::{
|
||||
use futures::{FutureExt, StreamExt, pin_mut};
|
||||
use ruma::{
|
||||
api::client::user_directory::search_users::{self},
|
||||
events::room::join_rules::JoinRule,
|
||||
};
|
||||
use tuwunel_core::{
|
||||
Result,
|
||||
utils::{
|
||||
future::BoolExt,
|
||||
stream::{BroadbandExt, ReadyExt},
|
||||
},
|
||||
};
|
||||
use futures::{FutureExt, StreamExt, pin_mut};
|
||||
use ruma::{
|
||||
api::client::user_directory::search_users::{self},
|
||||
events::room::join_rules::JoinRule,
|
||||
};
|
||||
|
||||
use crate::Ruma;
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@ use std::time::{Duration, SystemTime};
|
||||
|
||||
use axum::extract::State;
|
||||
use base64::{Engine as _, engine::general_purpose};
|
||||
use conduwuit::{Err, Result, utils};
|
||||
use hmac::{Hmac, Mac};
|
||||
use ruma::{SecondsSinceUnixEpoch, UserId, api::client::voip::get_turn_server_info};
|
||||
use sha1::Sha1;
|
||||
use tuwunel_core::{Err, Result, utils};
|
||||
|
||||
use crate::Ruma;
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
use axum::{Json, extract::State, response::IntoResponse};
|
||||
use conduwuit::{Error, Result};
|
||||
use ruma::api::client::{
|
||||
discovery::{
|
||||
discover_homeserver::{self, HomeserverInfo, SlidingSyncProxyInfo},
|
||||
@@ -7,6 +6,7 @@ use ruma::api::client::{
|
||||
},
|
||||
error::ErrorKind,
|
||||
};
|
||||
use tuwunel_core::{Error, Result};
|
||||
|
||||
use crate::Ruma;
|
||||
|
||||
@@ -94,6 +94,6 @@ pub(crate) async fn syncv3_client_server_json(
|
||||
|
||||
Ok(Json(serde_json::json!({
|
||||
"server": server_url,
|
||||
"version": conduwuit::version(),
|
||||
"version": tuwunel_core::version(),
|
||||
})))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user