diff --git a/Riot/Modules/Room/TimelineCells/BaseRoomCell/BaseRoomCell.swift b/Riot/Modules/Room/TimelineCells/BaseRoomCell/BaseRoomCell.swift index 711c9c02f..24f6a81b6 100644 --- a/Riot/Modules/Room/TimelineCells/BaseRoomCell/BaseRoomCell.swift +++ b/Riot/Modules/Room/TimelineCells/BaseRoomCell/BaseRoomCell.swift @@ -148,7 +148,7 @@ class BaseRoomCell: MXKRoomBubbleTableViewCell, BaseRoomCellProtocol { bubbleCellReadReceiptsDisplayable.removeReadReceiptsView() } - if let bubbleCellReactionsDisplayable = self as? BubbleCellReactionsDisplayable { + if let bubbleCellReactionsDisplayable = self as? RoomCellReactionsDisplayable { bubbleCellReactionsDisplayable.removeReactionsView() } diff --git a/Riot/Modules/Room/TimelineCells/BaseRoomCell/RoomCellContentView.swift b/Riot/Modules/Room/TimelineCells/BaseRoomCell/RoomCellContentView.swift index 1774b8e06..7d8b6ffe8 100644 --- a/Riot/Modules/Room/TimelineCells/BaseRoomCell/RoomCellContentView.swift +++ b/Riot/Modules/Room/TimelineCells/BaseRoomCell/RoomCellContentView.swift @@ -187,7 +187,7 @@ extension RoomCellContentView: BubbleCellReadReceiptsDisplayable { } // MARK: - BubbleCellReactionsDisplayable -extension RoomCellContentView: BubbleCellReactionsDisplayable { +extension RoomCellContentView: RoomCellReactionsDisplayable { func addReactionsView(_ reactionsView: UIView) { self.reactionsContentView.vc_removeAllSubviews() diff --git a/Riot/Modules/Room/TimelineCells/BaseRoomCell/BubbleCellReactionsDisplayable.swift b/Riot/Modules/Room/TimelineCells/BaseRoomCell/RoomCellReactionsDisplayable.swift similarity index 81% rename from Riot/Modules/Room/TimelineCells/BaseRoomCell/BubbleCellReactionsDisplayable.swift rename to Riot/Modules/Room/TimelineCells/BaseRoomCell/RoomCellReactionsDisplayable.swift index 91eb3de41..ff8671f7f 100644 --- a/Riot/Modules/Room/TimelineCells/BaseRoomCell/BubbleCellReactionsDisplayable.swift +++ b/Riot/Modules/Room/TimelineCells/BaseRoomCell/RoomCellReactionsDisplayable.swift @@ -16,8 +16,8 @@ import Foundation -/// `BubbleCellReactionsDisplayable` is a protocol indicating that a cell support displaying reactions. -@objc protocol BubbleCellReactionsDisplayable { +/// `RoomCellReactionsDisplayable` is a protocol indicating that a cell support displaying reactions. +@objc protocol RoomCellReactionsDisplayable { func addReactionsView(_ reactionsView: UIView) func removeReactionsView() } diff --git a/Riot/Modules/Room/TimelineCells/SizableCell/SizableBubbleCell.swift b/Riot/Modules/Room/TimelineCells/SizableCell/SizableBubbleCell.swift index 1275adac3..46f1c9fc2 100644 --- a/Riot/Modules/Room/TimelineCells/SizableCell/SizableBubbleCell.swift +++ b/Riot/Modules/Room/TimelineCells/SizableCell/SizableBubbleCell.swift @@ -124,7 +124,7 @@ class SizableBaseBubbleCell: BaseRoomCell, SizableBaseBubbleCellType { } // Add reactions view height if needed - if sizingView is BubbleCellReactionsDisplayable, + if sizingView is RoomCellReactionsDisplayable, let roomBubbleCellData = cellData as? RoomBubbleCellData, let bubbleReactionsViewModel = self.reactionsViewModelBuilder.buildForFirstVisibleComponent(of: roomBubbleCellData) { diff --git a/Riot/Modules/Room/TimelineCells/Styles/Bubble/BubbleRoomTimelineCellDecorator.swift b/Riot/Modules/Room/TimelineCells/Styles/Bubble/BubbleRoomTimelineCellDecorator.swift index 44efeceb1..51d4e324c 100644 --- a/Riot/Modules/Room/TimelineCells/Styles/Bubble/BubbleRoomTimelineCellDecorator.swift +++ b/Riot/Modules/Room/TimelineCells/Styles/Bubble/BubbleRoomTimelineCellDecorator.swift @@ -93,7 +93,7 @@ class BubbleRoomTimelineCellDecorator: PlainRoomTimelineCellDecorator { override func addReactionView(_ reactionsView: BubbleReactionsView, toCell cell: MXKRoomBubbleTableViewCell, cellData: RoomBubbleCellData, contentViewPositionY: CGFloat, upperDecorationView: UIView?) { - if let reactionsDisplayable = cell as? BubbleCellReactionsDisplayable { + if let reactionsDisplayable = cell as? RoomCellReactionsDisplayable { reactionsDisplayable.addReactionsView(reactionsView) return } diff --git a/Riot/Modules/Room/TimelineCells/Styles/Bubble/Cells/FileWithoutThumbnail/Common/FileWithoutThumbnailBaseBubbleCell.swift b/Riot/Modules/Room/TimelineCells/Styles/Bubble/Cells/FileWithoutThumbnail/Common/FileWithoutThumbnailBaseBubbleCell.swift index 904dcf1b6..d2732155f 100644 --- a/Riot/Modules/Room/TimelineCells/Styles/Bubble/Cells/FileWithoutThumbnail/Common/FileWithoutThumbnailBaseBubbleCell.swift +++ b/Riot/Modules/Room/TimelineCells/Styles/Bubble/Cells/FileWithoutThumbnail/Common/FileWithoutThumbnailBaseBubbleCell.swift @@ -16,7 +16,7 @@ import UIKit -class FileWithoutThumbnailBaseBubbleCell: SizableBaseBubbleCell, BubbleCellReactionsDisplayable { +class FileWithoutThumbnailBaseBubbleCell: SizableBaseBubbleCell, RoomCellReactionsDisplayable { weak var fileAttachementView: FileWithoutThumbnailCellContentView? diff --git a/Riot/Modules/Room/TimelineCells/Styles/Bubble/Cells/TextMessage/Common/TextMessageBaseBubbleCell.swift b/Riot/Modules/Room/TimelineCells/Styles/Bubble/Cells/TextMessage/Common/TextMessageBaseBubbleCell.swift index 3cd7d847c..5fc4de018 100644 --- a/Riot/Modules/Room/TimelineCells/Styles/Bubble/Cells/TextMessage/Common/TextMessageBaseBubbleCell.swift +++ b/Riot/Modules/Room/TimelineCells/Styles/Bubble/Cells/TextMessage/Common/TextMessageBaseBubbleCell.swift @@ -16,7 +16,7 @@ import UIKit -class TextMessageBaseBubbleCell: SizableBaseBubbleCell, RoomCellURLPreviewDisplayable, BubbleCellReactionsDisplayable, BubbleCellThreadSummaryDisplayable, BubbleCellReadReceiptsDisplayable { +class TextMessageBaseBubbleCell: SizableBaseBubbleCell, RoomCellURLPreviewDisplayable, RoomCellReactionsDisplayable, BubbleCellThreadSummaryDisplayable, BubbleCellReadReceiptsDisplayable { // MARK: - Properties diff --git a/Riot/Modules/Room/TimelineCells/Styles/Plain/Cells/Location/LocationBubbleCell.swift b/Riot/Modules/Room/TimelineCells/Styles/Plain/Cells/Location/LocationBubbleCell.swift index d0858a44a..724ac8459 100644 --- a/Riot/Modules/Room/TimelineCells/Styles/Plain/Cells/Location/LocationBubbleCell.swift +++ b/Riot/Modules/Room/TimelineCells/Styles/Plain/Cells/Location/LocationBubbleCell.swift @@ -16,7 +16,7 @@ import Foundation -class LocationBubbleCell: SizableBaseBubbleCell, BubbleCellReactionsDisplayable { +class LocationBubbleCell: SizableBaseBubbleCell, RoomCellReactionsDisplayable { private var locationView: RoomTimelineLocationView! diff --git a/Riot/Modules/Room/TimelineCells/Styles/Plain/Cells/Poll/PollBubbleCell.swift b/Riot/Modules/Room/TimelineCells/Styles/Plain/Cells/Poll/PollBubbleCell.swift index 3bbdf917f..dfa193cb6 100644 --- a/Riot/Modules/Room/TimelineCells/Styles/Plain/Cells/Poll/PollBubbleCell.swift +++ b/Riot/Modules/Room/TimelineCells/Styles/Plain/Cells/Poll/PollBubbleCell.swift @@ -16,7 +16,7 @@ import Foundation -class PollBubbleCell: SizableBaseBubbleCell, BubbleCellReactionsDisplayable { +class PollBubbleCell: SizableBaseBubbleCell, RoomCellReactionsDisplayable { private var pollView: UIView? private var event: MXEvent? diff --git a/Riot/Modules/Room/TimelineCells/Styles/Plain/Cells/VoiceMessage/VoiceMessageBubbleCell.swift b/Riot/Modules/Room/TimelineCells/Styles/Plain/Cells/VoiceMessage/VoiceMessageBubbleCell.swift index ebecb1ad1..76f4037e2 100644 --- a/Riot/Modules/Room/TimelineCells/Styles/Plain/Cells/VoiceMessage/VoiceMessageBubbleCell.swift +++ b/Riot/Modules/Room/TimelineCells/Styles/Plain/Cells/VoiceMessage/VoiceMessageBubbleCell.swift @@ -16,7 +16,7 @@ import Foundation -class VoiceMessageBubbleCell: SizableBaseBubbleCell, BubbleCellReactionsDisplayable { +class VoiceMessageBubbleCell: SizableBaseBubbleCell, RoomCellReactionsDisplayable { private(set) var playbackController: VoiceMessagePlaybackController! diff --git a/Riot/Modules/Room/TimelineCells/Styles/Plain/PlainRoomTimelineCellDecorator.swift b/Riot/Modules/Room/TimelineCells/Styles/Plain/PlainRoomTimelineCellDecorator.swift index a4e4bb8ae..11951db56 100644 --- a/Riot/Modules/Room/TimelineCells/Styles/Plain/PlainRoomTimelineCellDecorator.swift +++ b/Riot/Modules/Room/TimelineCells/Styles/Plain/PlainRoomTimelineCellDecorator.swift @@ -76,7 +76,7 @@ class PlainRoomTimelineCellDecorator: RoomTimelineCellDecorator { cell.addTemporarySubview(reactionsView) - if let reactionsDisplayable = cell as? BubbleCellReactionsDisplayable { + if let reactionsDisplayable = cell as? RoomCellReactionsDisplayable { reactionsDisplayable.addReactionsView(reactionsView) } else { reactionsView.translatesAutoresizingMaskIntoConstraints = false