mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-16 03:55:42 -04:00
ui: Move ReactionSenderData to reactions module and re-export publically
This commit is contained in:
committed by
Jonas Platte
parent
145c796294
commit
67abf707ff
@@ -53,10 +53,10 @@ use super::{
|
||||
item::{new_timeline_item, timeline_item},
|
||||
read_receipts::maybe_add_implicit_read_receipt,
|
||||
rfind_event_by_id, rfind_event_item, EventTimelineItem, Message, OtherState, ReactionGroup,
|
||||
Sticker, TimelineDetails, TimelineInnerState, TimelineItem, TimelineItemContent,
|
||||
VirtualTimelineItem, DEFAULT_SANITIZER_MODE,
|
||||
ReactionSenderData, Sticker, TimelineDetails, TimelineInnerState, TimelineItem,
|
||||
TimelineItemContent, VirtualTimelineItem, DEFAULT_SANITIZER_MODE,
|
||||
};
|
||||
use crate::{events::SyncTimelineEventWithoutContent, timeline::event_item::ReactionSenderData};
|
||||
use crate::events::SyncTimelineEventWithoutContent;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub(super) enum Flow {
|
||||
|
||||
@@ -65,9 +65,10 @@ use ruma::{
|
||||
use tracing::warn;
|
||||
use tracing::{debug, error};
|
||||
|
||||
use super::{EventItemIdentifier, EventTimelineItem, Profile, ReactionSenderData, TimelineDetails};
|
||||
use super::{EventItemIdentifier, EventTimelineItem, Profile, TimelineDetails};
|
||||
use crate::timeline::{
|
||||
traits::RoomDataProvider, Error as TimelineError, TimelineItem, DEFAULT_SANITIZER_MODE,
|
||||
traits::RoomDataProvider, Error as TimelineError, ReactionSenderData, TimelineItem,
|
||||
DEFAULT_SANITIZER_MODE,
|
||||
};
|
||||
|
||||
/// The content of an [`EventTimelineItem`][super::EventTimelineItem].
|
||||
|
||||
@@ -81,17 +81,6 @@ pub enum EventItemIdentifier {
|
||||
EventId(OwnedEventId),
|
||||
}
|
||||
|
||||
/// Data associated with a reaction sender. It can be used to display
|
||||
/// a details UI component for a reaction with both sender
|
||||
/// names and the date at which they sent a reaction.
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub struct ReactionSenderData {
|
||||
/// Sender identifier.
|
||||
pub sender_id: OwnedUserId,
|
||||
/// Date at which the sender reacted.
|
||||
pub timestamp: MilliSecondsSinceUnixEpoch,
|
||||
}
|
||||
|
||||
impl EventTimelineItem {
|
||||
pub(super) fn new(
|
||||
sender: OwnedUserId,
|
||||
|
||||
@@ -62,14 +62,14 @@ use super::{
|
||||
update_read_marker, Flow, HandleEventResult, TimelineEventHandler, TimelineEventKind,
|
||||
TimelineEventMetadata, TimelineItemPosition,
|
||||
},
|
||||
event_item::{EventItemIdentifier, ReactionSenderData},
|
||||
event_item::EventItemIdentifier,
|
||||
item::{new_timeline_item, timeline_item},
|
||||
reactions::ReactionToggleResult,
|
||||
rfind_event_by_id, rfind_event_item,
|
||||
traits::RoomDataProvider,
|
||||
AnnotationKey, EventSendState, EventTimelineItem, InReplyToDetails, Message, Profile,
|
||||
RelativePosition, RepliedToEvent, TimelineDetails, TimelineItem, TimelineItemContent,
|
||||
TimelineItemKind,
|
||||
ReactionSenderData, RelativePosition, RepliedToEvent, TimelineDetails, TimelineItem,
|
||||
TimelineItemContent, TimelineItemKind,
|
||||
};
|
||||
use crate::events::SyncTimelineEventWithoutContent;
|
||||
|
||||
|
||||
@@ -80,6 +80,7 @@ pub use self::{
|
||||
futures::SendAttachment,
|
||||
item::{TimelineItem, TimelineItemKind},
|
||||
pagination::{PaginationOptions, PaginationOutcome},
|
||||
reactions::ReactionSenderData,
|
||||
traits::RoomExt,
|
||||
virtual_item::VirtualTimelineItem,
|
||||
};
|
||||
|
||||
@@ -12,7 +12,18 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
use ruma::{OwnedEventId, OwnedTransactionId};
|
||||
use ruma::{MilliSecondsSinceUnixEpoch, OwnedEventId, OwnedTransactionId, OwnedUserId};
|
||||
|
||||
/// Data associated with a reaction sender. It can be used to display
|
||||
/// a details UI component for a reaction with both sender
|
||||
/// names and the date at which they sent a reaction.
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub struct ReactionSenderData {
|
||||
/// Sender identifier.
|
||||
pub sender_id: OwnedUserId,
|
||||
/// Date at which the sender reacted.
|
||||
pub timestamp: MilliSecondsSinceUnixEpoch,
|
||||
}
|
||||
|
||||
/// The result of toggling a reaction
|
||||
///
|
||||
|
||||
@@ -17,9 +17,9 @@ use itertools::Itertools;
|
||||
use ruma::{server_name, uint, user_id, EventId, MilliSecondsSinceUnixEpoch, OwnedUserId, UserId};
|
||||
|
||||
use crate::timeline::{
|
||||
event_item::{EventItemIdentifier, ReactionSenderData},
|
||||
event_item::EventItemIdentifier,
|
||||
tests::{ALICE, BOB},
|
||||
ReactionGroup,
|
||||
ReactionGroup, ReactionSenderData,
|
||||
};
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user