diff --git a/Riot/Modules/Room/Views/BubbleCells/BaseBubbleCell/BaseBubbleCell.swift b/Riot/Modules/Room/Views/BubbleCells/BaseBubbleCell/BaseBubbleCell.swift index 76abfe8e5..ba750c1d4 100644 --- a/Riot/Modules/Room/Views/BubbleCells/BaseBubbleCell/BaseBubbleCell.swift +++ b/Riot/Modules/Room/Views/BubbleCells/BaseBubbleCell/BaseBubbleCell.swift @@ -178,6 +178,10 @@ class BaseBubbleCell: MXKRoomBubbleTableViewCell, BaseBubbleCellType { if let timestampDisplayable = self as? TimestampDisplayable { timestampDisplayable.removeTimestampView() } + + if let urlPreviewDisplayable = self as? RoomCellURLPreviewDisplayable { + urlPreviewDisplayable.removeURLPreviewView() + } } override func render(_ cellData: MXKCellData!) { @@ -234,6 +238,17 @@ class BaseBubbleCell: MXKRoomBubbleTableViewCell, BaseBubbleCellType { self.bubbleCellContentView = bubbleCellContentView } + // MARK: - RoomCellURLPreviewDisplayable + // Cannot use default implementation with ObjC protocol, if self conforms to BubbleCellReadReceiptsDisplayable method below will be used + + func addURLPreviewView(_ urlPreviewView: UIView) { + self.bubbleCellContentView?.addURLPreviewView(urlPreviewView) + } + + func removeURLPreviewView() { + self.bubbleCellContentView?.removeURLPreviewView() + } + // MARK: - BubbleCellReadReceiptsDisplayable // Cannot use default implementation with ObjC protocol, if self conforms to BubbleCellReadReceiptsDisplayable method below will be used