Skip to content

Commit

Permalink
Merge pull request #2460 from bitfriend/activate-integration-test
Browse files Browse the repository at this point in the history
Miscellaneous fixes
  • Loading branch information
bitfriend authored Dec 25, 2024
2 parents 6b04b94 + 014466d commit 53f1978
Show file tree
Hide file tree
Showing 10 changed files with 107 additions and 119 deletions.
31 changes: 14 additions & 17 deletions native/acter/src/api/client/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;

Expand Down
48 changes: 25 additions & 23 deletions native/acter/src/api/room.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 5 additions & 2 deletions native/acter/src/api/rsvp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
18 changes: 10 additions & 8 deletions native/acter/src/api/search.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
16 changes: 10 additions & 6 deletions native/acter/src/api/settings/space.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down
47 changes: 13 additions & 34 deletions native/acter/src/api/spaces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
12 changes: 7 additions & 5 deletions native/acter/src/api/stories.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
30 changes: 13 additions & 17 deletions native/acter/src/api/stream.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
13 changes: 8 additions & 5 deletions native/acter/src/api/tasks.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
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,
};
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},
Expand Down
4 changes: 2 additions & 2 deletions native/acter/src/api/typing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 53f1978

Please sign in to comment.