diff --git a/Tusker/Views/Status/BaseStatusTableViewCell.swift b/Tusker/Views/Status/BaseStatusTableViewCell.swift index bf0fe2a8..343a2e8e 100644 --- a/Tusker/Views/Status/BaseStatusTableViewCell.swift +++ b/Tusker/Views/Status/BaseStatusTableViewCell.swift @@ -328,10 +328,16 @@ extension BaseStatusTableViewCell: MenuPreviewProvider { ) } else if attachmentsView.frame.contains(location) { let attachmentsViewLocation = attachmentsView.convert(location, from: self) - if let attachmentView = attachmentsView.attachmentViews.allObjects.first(where: { $0.frame.contains(attachmentsViewLocation) }), - let image = attachmentView.image { - let description = attachmentView.attachment.description - return (content: { self.delegate?.largeImage(image, description: description, sourceView: attachmentView) }, actions: { [] }) + if let attachmentView = attachmentsView.attachmentViews.allObjects.first(where: { $0.frame.contains(attachmentsViewLocation) }) { + return ( + content: { + let attachments = self.attachmentsView.attachments! + let sourceViews = attachments.map(self.attachmentsView.getAttachmentView(for:)) + let startIndex = sourceViews.firstIndex(of: attachmentView)! + return self.delegate?.gallery(attachments: attachments, sourceViews: sourceViews, startIndex: startIndex) + }, + actions: { [] } + ) } }/* else if contentLabel.frame.contains(location), let link = contentLabel.getLink(atPoint: contentLabel.convert(location, from: self)) {