Skip to content

Commit

Permalink
chore(ui): rename "utils" to "algorithms"
Browse files Browse the repository at this point in the history
It only contains functions used to search items in the timeline now \o/
  • Loading branch information
bnjbvr committed Jan 9, 2025
1 parent 17c6bb2 commit 173c084
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
File renamed without changes.
4 changes: 2 additions & 2 deletions crates/matrix-sdk-ui/src/timeline/controller/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,22 @@ pub(super) use self::{
},
};
use super::{
algorithms::{rfind_event_by_id, rfind_event_item},
event_handler::TimelineEventKind,
event_item::{ReactionStatus, RemoteEventOrigin},
item::TimelineUniqueId,
traits::{Decryptor, RoomDataProvider},
util::{rfind_event_by_id, rfind_event_item},
DateDividerMode, Error, EventSendState, EventTimelineItem, InReplyToDetails, Message,
PaginationError, Profile, ReactionInfo, RepliedToEvent, TimelineDetails, TimelineEventItemId,
TimelineFocus, TimelineItem, TimelineItemContent, TimelineItemKind,
};
use crate::{
timeline::{
algorithms::rfind_event_by_item_id,
date_dividers::DateDividerAdjuster,
event_item::EventTimelineItemKind,
pinned_events_loader::{PinnedEventsLoader, PinnedEventsLoaderError},
reactions::FullReactionKey,
util::rfind_event_by_item_id,
TimelineEventFilterFn,
},
unable_to_decrypt_hook::UtdHookManager,
Expand Down
2 changes: 1 addition & 1 deletion crates/matrix-sdk-ui/src/timeline/controller/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ use super::{
use crate::{
events::SyncTimelineEventWithoutContent,
timeline::{
algorithms::rfind_event_by_id,
date_dividers::DateDividerAdjuster,
event_handler::{
Flow, HandleEventResult, TimelineEventContext, TimelineEventHandler, TimelineEventKind,
Expand All @@ -64,7 +65,6 @@ use crate::{
item::TimelineUniqueId,
reactions::Reactions,
traits::RoomDataProvider,
util::rfind_event_by_id,
Profile, TimelineItem, TimelineItemKind,
},
unable_to_decrypt_hook::UtdHookManager,
Expand Down
2 changes: 1 addition & 1 deletion crates/matrix-sdk-ui/src/timeline/event_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ use ruma::{
use tracing::{debug, error, field::debug, info, instrument, trace, warn};

use super::{
algorithms::{rfind_event_by_id, rfind_event_item},
controller::{
ObservableItemsTransaction, ObservableItemsTransactionEntry, PendingEdit, PendingEditKind,
TimelineMetadata, TimelineStateTransaction,
Expand All @@ -64,7 +65,6 @@ use super::{
},
reactions::{FullReactionKey, PendingReaction},
traits::RoomDataProvider,
util::{rfind_event_by_id, rfind_event_item},
EventTimelineItem, InReplyToDetails, OtherState, RepliedToEvent, Sticker, TimelineDetails,
TimelineItem, TimelineItemContent,
};
Expand Down
8 changes: 5 additions & 3 deletions crates/matrix-sdk-ui/src/timeline/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use std::{fs, path::PathBuf, pin::Pin, sync::Arc, task::Poll};

use algorithms::rfind_event_by_item_id;
use event_item::{extract_room_msg_edit_content, TimelineItemHandle};
use eyeball_im::VectorDiff;
use futures_core::Stream;
Expand Down Expand Up @@ -53,10 +54,13 @@ use ruma::{
};
use thiserror::Error;
use tracing::{error, instrument, trace, warn};
use util::rfind_event_by_item_id;

use self::{
algorithms::rfind_event_by_id, controller::TimelineController, futures::SendAttachment,
};
use crate::timeline::pinned_events_loader::PinnedEventsRoom;

mod algorithms;
mod builder;
mod controller;
mod date_dividers;
Expand All @@ -73,7 +77,6 @@ mod reactions;
mod tests;
mod to_device;
mod traits;
mod util;
mod virtual_item;

pub use self::{
Expand All @@ -93,7 +96,6 @@ pub use self::{
traits::RoomExt,
virtual_item::VirtualTimelineItem,
};
use self::{controller::TimelineController, futures::SendAttachment, util::rfind_event_by_id};

/// Information needed to reply to an event.
#[derive(Debug, Clone)]
Expand Down
2 changes: 1 addition & 1 deletion crates/matrix-sdk-ui/src/timeline/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ use ruma::{
use tokio::sync::RwLock;

use super::{
algorithms::rfind_event_by_item_id,
controller::{TimelineNewItemPosition, TimelineSettings},
event_handler::TimelineEventKind,
event_item::RemoteEventOrigin,
traits::RoomDataProvider,
util::rfind_event_by_item_id,
EventTimelineItem, Profile, TimelineController, TimelineEventItemId, TimelineFocus,
TimelineItem,
};
Expand Down

0 comments on commit 173c084

Please sign in to comment.