mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-05 11:58:32 +00:00
Allow previews in the timeline to include filtered galleries (#5943)
* remove the usage of the timeline kind override in favour of getting it properly from the timeline view model * allow the previews to include gallery items filtered by the allowed types when started outside the gallery sss asa * fix for actions not being forwarded to the timeline right * pr suggestions
This commit is contained in:
@@ -44,12 +44,16 @@ class TimelineController: TimelineControllerProtocol {
|
||||
activeTimelineItemProvider.kind
|
||||
}
|
||||
|
||||
let allowedGalleryItemTypes: [TimelineAllowedGalleryItemType]?
|
||||
|
||||
init(roomProxy: JoinedRoomProxyProtocol,
|
||||
timelineProxy: TimelineProxyProtocol,
|
||||
initialFocussedEventID: String?,
|
||||
timelineItemFactory: RoomTimelineItemFactoryProtocol,
|
||||
mediaProvider: MediaProviderProtocol,
|
||||
appSettings: AppSettings) {
|
||||
appSettings: AppSettings,
|
||||
allowedGalleryItemTypes: [TimelineAllowedGalleryItemType]? = nil) {
|
||||
self.allowedGalleryItemTypes = allowedGalleryItemTypes
|
||||
self.roomProxy = roomProxy
|
||||
liveTimelineItemProvider = timelineProxy.timelineItemProvider
|
||||
self.timelineItemFactory = timelineItemFactory
|
||||
|
||||
+2
-1
@@ -71,7 +71,8 @@ struct TimelineControllerFactory: TimelineControllerFactoryProtocol {
|
||||
initialFocussedEventID: nil,
|
||||
timelineItemFactory: timelineItemFactory,
|
||||
mediaProvider: mediaProvider,
|
||||
appSettings: appSettings))
|
||||
appSettings: appSettings,
|
||||
allowedGalleryItemTypes: allowedMessageTypes.allowedGalleryItemTypes))
|
||||
case .failure(let error):
|
||||
return .failure(.roomProxyError(error))
|
||||
}
|
||||
|
||||
+4
-1
@@ -26,7 +26,7 @@ enum TimelineControllerAction {
|
||||
}
|
||||
|
||||
case displayMediaPreview(item: EventBasedMessageTimelineItemProtocol, timelineViewModel: TimelineViewModelKind)
|
||||
case displayGalleryPreview(galleryItem: GalleryRoomTimelineItem, initialIndex: Int)
|
||||
case displayGalleryPreview(galleryItem: GalleryRoomTimelineItem, timelineViewModel: TimelineViewModelKind)
|
||||
case displayLocation(StaticLocationData)
|
||||
case displayLiveLocation(sender: TimelineItemSender, initialLiveLocationShare: LiveLocationShare)
|
||||
case none
|
||||
@@ -47,6 +47,9 @@ enum TimelineControllerError: Error {
|
||||
protocol TimelineControllerProtocol: Sendable {
|
||||
var timelineKind: TimelineKind { get }
|
||||
|
||||
/// The gallery attachments this timeline includes, or `nil` when it isn't filtered.
|
||||
var allowedGalleryItemTypes: [TimelineAllowedGalleryItemType]? { get }
|
||||
|
||||
/// The currently known items, use only for setting up the intial state.
|
||||
var timelineItems: [RoomTimelineItemProtocol] { get }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user