Skip to content

Commit

Permalink
feat(sdk,ui): Add EventsOrigin::Pagination.
Browse files Browse the repository at this point in the history
This patch adds the `Pagination` variant to the `EventsOrigin` enum.
Not something really mandatory and that is likely to fix a bug, but it's
now correct.
  • Loading branch information
Hywan committed Jan 8, 2025
1 parent 9ca6956 commit cdb287b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions crates/matrix-sdk-ui/src/timeline/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ impl TimelineBuilder {
diffs,
match origin {
EventsOrigin::Sync => RemoteEventOrigin::Sync,
EventsOrigin::Pagination => RemoteEventOrigin::Pagination,
}
).await;
}
Expand Down
3 changes: 3 additions & 0 deletions crates/matrix-sdk/src/event_cache/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,9 @@ pub enum RoomEventCacheUpdate {
pub enum EventsOrigin {
/// Events are coming from a sync.
Sync,

/// Events are coming from pagination.
Pagination,
}

#[cfg(test)]
Expand Down
2 changes: 1 addition & 1 deletion crates/matrix-sdk/src/event_cache/pagination.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ impl RoomPagination {
if !sync_timeline_events_diffs.is_empty() {
let _ = self.inner.sender.send(RoomEventCacheUpdate::UpdateTimelineEvents {
diffs: sync_timeline_events_diffs,
origin: EventsOrigin::Sync,
origin: EventsOrigin::Pagination,
});
}

Expand Down

0 comments on commit cdb287b

Please sign in to comment.