diff --git a/native/acter/src/api/client/sync.rs b/native/acter/src/api/client/sync.rs index 4a4590a09278..9679a811bdea 100644 --- a/native/acter/src/api/client/sync.rs +++ b/native/acter/src/api/client/sync.rs @@ -10,25 +10,22 @@ use futures::{ stream::{Stream, StreamExt}, }; use futures_signals::signal::{Mutable, MutableSignalCloned, SignalExt, SignalStream}; -use matrix_sdk::{ - config::SyncSettings, - event_handler::{Ctx, EventHandlerHandle}, - room::Room as SdkRoom, - RoomState, RumaApiError, -}; -use matrix_sdk_base::ruma::events::AnySyncEphemeralRoomEvent; -use matrix_sdk_base::ruma::{ - api::client::{ - error::{ErrorBody, ErrorKind}, - Error, +use matrix_sdk::{config::SyncSettings, event_handler::Ctx, room::Room as SdkRoom, RumaApiError}; +use matrix_sdk_base::{ + ruma::{ + api::client::{ + error::{ErrorBody, ErrorKind}, + Error, + }, + events::room::redaction::{RoomRedactionEvent, SyncRoomRedactionEvent}, + OwnedRoomId, }, - OwnedRoomId, + RoomState, }; -use ruma::events::room::redaction::{RoomRedactionEvent, SyncRoomRedactionEvent}; use std::{ - collections::{btree_map::Entry, BTreeMap, HashMap}, + collections::BTreeMap, io::Write, - ops::{Deref, Index}, + ops::Deref, sync::{ atomic::{AtomicBool, Ordering}, Arc, @@ -37,14 +34,14 @@ use std::{ use tokio::{ sync::{ broadcast::{channel, Receiver}, - Mutex, RwLockWriteGuard, + RwLockWriteGuard, }, task::JoinHandle, }; use tokio_stream::wrappers::BroadcastStream; use tracing::{error, info, trace, warn}; -use crate::{api::spaces::HistoryState, Convo, Room, Space, RUNTIME}; +use crate::{Convo, Room, Space, RUNTIME}; use super::Client; diff --git a/native/acter/src/api/room.rs b/native/acter/src/api/room.rs index 46bf70d9556e..38ea107b99cb 100644 --- a/native/acter/src/api/room.rs +++ b/native/acter/src/api/room.rs @@ -18,35 +18,37 @@ use acter_core::{ use anyhow::{bail, Context, Result}; use futures::Stream; use matrix_sdk::{ - deserialized_responses::SyncOrStrippedState, - media::{MediaFormat, MediaRequestParameters}, notification_settings::{IsEncrypted, IsOneToOne}, room::{Room as SdkRoom, RoomMember}, - RoomDisplayName, RoomMemberships, RoomState, }; -use matrix_sdk_base::ruma::{ - api::client::{ - room::report_content, - space::{get_hierarchy, SpaceHierarchyRoomsChunk}, - }, - assign, - events::{ - room::{ - avatar::ImageInfo as AvatarImageInfo, - join_rules::{ - AllowRule, JoinRule, Restricted, RoomJoinRulesEventContent, RoomMembership, +use matrix_sdk_base::{ + deserialized_responses::SyncOrStrippedState, + media::{MediaFormat, MediaRequestParameters}, + ruma::{ + api::client::{ + room::report_content, + space::{get_hierarchy, SpaceHierarchyRoomsChunk}, + }, + assign, + events::{ + room::{ + avatar::ImageInfo as AvatarImageInfo, + join_rules::{ + AllowRule, JoinRule, Restricted, RoomJoinRulesEventContent, RoomMembership, + }, + message::{MessageType, RoomMessageEvent}, + MediaSource, }, - message::{MessageType, RoomMessageEvent}, - MediaSource, + space::{child::HierarchySpaceChildEvent, parent::SpaceParentEventContent}, + MessageLikeEventType, StateEvent, StateEventType, StaticEventContent, }, - space::{child::HierarchySpaceChildEvent, parent::SpaceParentEventContent}, - MessageLikeEventType, StateEvent, StateEventType, StaticEventContent, + room::RoomType, + serde::Raw, + space::SpaceRoomJoinRule, + EventId, IdParseError, Int, OwnedEventId, OwnedMxcUri, OwnedRoomAliasId, OwnedRoomId, + OwnedTransactionId, OwnedUserId, RoomId, ServerName, UserId, }, - room::RoomType, - serde::Raw, - space::SpaceRoomJoinRule, - EventId, IdParseError, Int, OwnedEventId, OwnedMxcUri, OwnedRoomAliasId, OwnedRoomId, - OwnedTransactionId, OwnedUserId, RoomId, ServerName, UserId, + RoomDisplayName, RoomMemberships, RoomState, }; use std::{fs::exists, io::Write, ops::Deref, path::PathBuf}; use tokio::fs; diff --git a/native/acter/src/api/rsvp.rs b/native/acter/src/api/rsvp.rs index ed9b59598dff..ab374e925bb0 100644 --- a/native/acter/src/api/rsvp.rs +++ b/native/acter/src/api/rsvp.rs @@ -7,8 +7,11 @@ use acter_core::{ use anyhow::{bail, Result}; use core::time::Duration; use futures::stream::StreamExt; -use matrix_sdk::{room::Room, RoomState}; -use matrix_sdk_base::ruma::{events::MessageLikeEventType, OwnedEventId, OwnedUserId}; +use matrix_sdk::room::Room; +use matrix_sdk_base::{ + ruma::{events::MessageLikeEventType, OwnedEventId, OwnedUserId}, + RoomState, +}; use std::{ops::Deref, str::FromStr}; use tokio::sync::broadcast::Receiver; use tokio_stream::{wrappers::BroadcastStream, Stream}; diff --git a/native/acter/src/api/search.rs b/native/acter/src/api/search.rs index ca97f03e6707..e009bc45a5f6 100644 --- a/native/acter/src/api/search.rs +++ b/native/acter/src/api/search.rs @@ -1,12 +1,14 @@ use anyhow::Result; -use matrix_sdk::media::MediaRequestParameters; -use matrix_sdk_base::ruma::{ - api::client::directory::get_public_rooms_filtered, - assign, - directory::{Filter, PublicRoomJoinRule, PublicRoomsChunk, RoomNetwork, RoomTypeFilter}, - events::room::MediaSource, - room::RoomType, - OwnedMxcUri, OwnedRoomAliasId, OwnedRoomId, ServerName, +use matrix_sdk_base::{ + media::MediaRequestParameters, + ruma::{ + api::client::directory::get_public_rooms_filtered, + assign, + directory::{Filter, PublicRoomJoinRule, PublicRoomsChunk, RoomNetwork, RoomTypeFilter}, + events::room::MediaSource, + room::RoomType, + OwnedMxcUri, OwnedRoomAliasId, OwnedRoomId, ServerName, + }, }; use super::{client::Client, RUNTIME}; diff --git a/native/acter/src/api/settings/space.rs b/native/acter/src/api/settings/space.rs index 4cf02af9fd0d..d1aba78ba302 100644 --- a/native/acter/src/api/settings/space.rs +++ b/native/acter/src/api/settings/space.rs @@ -15,13 +15,17 @@ use acter_core::events::{ tasks::{TaskEventContent, TaskListEventContent}, }; use anyhow::{bail, Context, Result}; -use matrix_sdk::deserialized_responses::SyncOrStrippedState; -use matrix_sdk_base::ruma::{ - events::{ - room::power_levels::{RoomPowerLevels as RumaRoomPowerLevels, RoomPowerLevelsEventContent}, - StateEventType, StaticEventContent, SyncStateEvent, TimelineEventType, +use matrix_sdk_base::{ + deserialized_responses::SyncOrStrippedState, + ruma::{ + events::{ + room::power_levels::{ + RoomPowerLevels as RumaRoomPowerLevels, RoomPowerLevelsEventContent, + }, + StateEventType, StaticEventContent, SyncStateEvent, TimelineEventType, + }, + Int, }, - Int, }; use std::{collections::btree_map, ops::Deref}; diff --git a/native/acter/src/api/spaces.rs b/native/acter/src/api/spaces.rs index 1020b2afe8ab..ea8f647c521a 100644 --- a/native/acter/src/api/spaces.rs +++ b/native/acter/src/api/spaces.rs @@ -5,45 +5,24 @@ pub use acter_core::spaces::{ SpaceRelations as CoreSpaceRelations, }; use acter_core::{ - error::Error, - events::{ - attachments::{SyncAttachmentEvent, SyncAttachmentUpdateEvent}, - calendar::{SyncCalendarEventEvent, SyncCalendarEventUpdateEvent}, - comments::{SyncCommentEvent, SyncCommentUpdateEvent}, - news::{SyncNewsEntryEvent, SyncNewsEntryUpdateEvent}, - pins::{SyncPinEvent, SyncPinUpdateEvent}, - read_receipt::SyncReadReceiptEvent, - rsvp::SyncRsvpEvent, - tasks::{ - SyncTaskEvent, SyncTaskListEvent, SyncTaskListUpdateEvent, SyncTaskSelfAssignEvent, - SyncTaskSelfUnassignEvent, SyncTaskUpdateEvent, - }, - AnyActerEvent, - }, - executor::Executor, - models::{AnyActerModel, EventMeta}, - statics::default_acter_space_states, - store::Store, - templates::Engine, + error::Error, events::AnyActerEvent, models::AnyActerModel, + statics::default_acter_space_states, store::Store, templates::Engine, }; use anyhow::{bail, Context, Result}; use futures::stream::StreamExt; -use matrix_sdk::{ +use matrix_sdk::room::{Messages, MessagesOptions}; +use matrix_sdk_base::{ deserialized_responses::SyncOrStrippedState, - event_handler::{Ctx, EventHandlerHandle}, - room::{Messages, MessagesOptions, Room as SdkRoom}, -}; -use matrix_sdk_base::ruma::{ - api::client::state::send_state_event, - assign, - events::{ - reaction::SyncReactionEvent, - room::redaction::{RoomRedactionEvent, SyncRoomRedactionEvent}, - space::child::SpaceChildEventContent, - AnyStateEventContent, MessageLikeEvent, MessageLikeEventType, StateEventType, + ruma::{ + api::client::state::send_state_event, + assign, + events::{ + space::child::SpaceChildEventContent, AnyStateEventContent, MessageLikeEventType, + StateEventType, + }, + serde::Raw, + OwnedRoomAliasId, OwnedRoomId, RoomAliasId, RoomId, RoomOrAliasId, ServerName, }, - serde::Raw, - OwnedRoomAliasId, OwnedRoomId, RoomAliasId, RoomId, RoomOrAliasId, ServerName, }; use matrix_sdk_ui::timeline::RoomExt; use serde::{Deserialize, Serialize}; diff --git a/native/acter/src/api/stories.rs b/native/acter/src/api/stories.rs index b37f87cb0e6e..e00568fbfe57 100644 --- a/native/acter/src/api/stories.rs +++ b/native/acter/src/api/stories.rs @@ -8,13 +8,15 @@ use acter_core::{ }; use anyhow::{bail, Context, Result}; use futures::stream::StreamExt; -use matrix_sdk::{room::Room, RoomState}; -use matrix_sdk_base::ruma::{ - events::{room::message::MessageType, MessageLikeEventType}, - OwnedEventId, OwnedRoomId, OwnedUserId, +use matrix_sdk::room::Room; +use matrix_sdk_base::{ + ruma::{ + events::{room::message::MessageType, MessageLikeEventType}, + OwnedEventId, OwnedRoomId, OwnedUserId, + }, + RoomState, }; use std::{ - any::Any, collections::{hash_map::Entry, HashMap}, ops::Deref, }; diff --git a/native/acter/src/api/stream.rs b/native/acter/src/api/stream.rs index cbc3e0022eda..dcc8e8819410 100644 --- a/native/acter/src/api/stream.rs +++ b/native/acter/src/api/stream.rs @@ -1,27 +1,23 @@ use anyhow::{bail, Context, Result}; use futures::stream::{Stream, StreamExt}; -use matrix_sdk::{ - room::{edit::EditedContent, Receipts}, - RoomState, -}; -use matrix_sdk_base::ruma::{ - api::client::receipt::create_receipt, - assign, - events::{ - receipt::ReceiptThread, - relation::Annotation, - room::{ - message::{ - AudioInfo, FileInfo, ForwardThread, LocationInfo, RoomMessageEvent, VideoInfo, +use matrix_sdk::room::{edit::EditedContent, Receipts}; +use matrix_sdk_base::{ + ruma::{ + api::client::receipt::create_receipt, + assign, + events::{ + receipt::ReceiptThread, + room::{ + message::{AudioInfo, FileInfo, ForwardThread, VideoInfo}, + ImageInfo, }, - ImageInfo, + MessageLikeEventType, }, - MessageLikeEventType, + EventId, OwnedEventId, OwnedTransactionId, }, - EventId, OwnedEventId, OwnedTransactionId, + RoomState, }; use matrix_sdk_ui::timeline::{Timeline, TimelineEventItemId}; -use ruma::TransactionId; use std::{ops::Deref, sync::Arc}; use tracing::info; diff --git a/native/acter/src/api/tasks.rs b/native/acter/src/api/tasks.rs index 5c10f5555cbe..007e9a3ce905 100644 --- a/native/acter/src/api/tasks.rs +++ b/native/acter/src/api/tasks.rs @@ -1,7 +1,7 @@ use acter_core::{ events::{ tasks::{self, Priority, TaskBuilder, TaskListBuilder}, - Color, Display, RefDetails, RefPreview, + Display, RefDetails, RefPreview, }, models::{self, can_redact, ActerModel, AnyActerModel, TaskStats}, statics::KEYS, @@ -9,10 +9,13 @@ use acter_core::{ use anyhow::{bail, Context, Result}; use chrono::DateTime; use futures::stream::StreamExt; -use matrix_sdk::{room::Room, RoomState}; -use matrix_sdk_base::ruma::{ - events::{room::message::TextMessageEventContent, MessageLikeEventType}, - EventId, OwnedEventId, OwnedRoomId, OwnedUserId, +use matrix_sdk::room::Room; +use matrix_sdk_base::{ + ruma::{ + events::{room::message::TextMessageEventContent, MessageLikeEventType}, + EventId, OwnedEventId, OwnedRoomId, OwnedUserId, + }, + RoomState, }; use std::{ collections::{hash_map::Entry, HashMap}, diff --git a/native/acter/src/api/typing.rs b/native/acter/src/api/typing.rs index 363c3987b8b6..c3e5a358d90e 100644 --- a/native/acter/src/api/typing.rs +++ b/native/acter/src/api/typing.rs @@ -3,12 +3,12 @@ use matrix_sdk::{ room::Room, Client as SdkClient, }; -use matrix_sdk_base::ruma::{events::typing::SyncTypingEvent, OwnedRoomId, OwnedUserId}; +use matrix_sdk_base::ruma::{events::typing::SyncTypingEvent, OwnedUserId}; use scc::hash_map::{Entry, HashMap}; use std::sync::Arc; use tokio::sync::broadcast::{channel, Receiver, Sender}; use tokio_stream::{wrappers::BroadcastStream, Stream, StreamExt}; -use tracing::{error, info, trace}; +use tracing::{error, trace}; use super::client::Client;