Introduce canMerge method on timeline style

This commit is contained in:
ismailgulek
2022-06-13 17:55:31 +03:00
parent 4b0f791d17
commit 10f2feaae6
3 changed files with 12 additions and 1 deletions
@@ -49,6 +49,10 @@ class BubbleRoomTimelineStyle: RoomTimelineStyle {
func canAddEvent(_ event: MXEvent, and roomState: MXRoomState, to cellData: MXKRoomBubbleCellData) -> Bool {
return false
}
func canMerge(cellData: MXKRoomBubbleCellDataStoring, into receiverCellData: MXKRoomBubbleCellDataStoring) -> Bool {
return false
}
func applySelectedStyleIfNeeded(toCell cell: MXKRoomBubbleTableViewCell, cellData: RoomBubbleCellData) {
@@ -49,6 +49,10 @@ class PlainRoomTimelineStyle: RoomTimelineStyle {
func canAddEvent(_ event: MXEvent, and roomState: MXRoomState, to cellData: MXKRoomBubbleCellData) -> Bool {
return true
}
func canMerge(cellData: MXKRoomBubbleCellDataStoring, into receiverCellData: MXKRoomBubbleCellDataStoring) -> Bool {
return true
}
func applySelectedStyleIfNeeded(toCell cell: MXKRoomBubbleTableViewCell, cellData: RoomBubbleCellData) {
@@ -39,7 +39,10 @@ protocol RoomTimelineStyle: Themable {
/// Indicate to merge or not event in timeline
func canAddEvent(_ event: MXEvent, and roomState: MXRoomState, to cellData: MXKRoomBubbleCellData) -> Bool
/// Indicate to merge or not the `cellData` into `receiverCellData`
func canMerge(cellData: MXKRoomBubbleCellDataStoring, into receiverCellData: MXKRoomBubbleCellDataStoring) -> Bool
/// Apply selected or blurred style on cell
func applySelectedStyleIfNeeded(toCell cell: MXKRoomBubbleTableViewCell, cellData: RoomBubbleCellData)
}