Merge pull request #901 from mpretty-cyro/fix/call-messages-not-marking-as-read
Fixed an issue where call messages wouldn't get marked as read when the last message in a conversation
This commit is contained in:
commit
fbae340bda
|
@ -1951,14 +1951,22 @@ final class ConversationVC: BaseVC, SessionUtilRespondingViewController, Convers
|
||||||
.sorted()
|
.sorted()
|
||||||
.filter({ $0.section == messagesSection })
|
.filter({ $0.section == messagesSection })
|
||||||
.compactMap({ indexPath -> (frame: CGRect, cellViewModel: MessageViewModel)? in
|
.compactMap({ indexPath -> (frame: CGRect, cellViewModel: MessageViewModel)? in
|
||||||
guard let cell: VisibleMessageCell = tableView.cellForRow(at: indexPath) as? VisibleMessageCell else {
|
guard let cell: UITableViewCell = tableView.cellForRow(at: indexPath) else { return nil }
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
switch cell {
|
||||||
view.convert(cell.frame, from: tableView),
|
case is VisibleMessageCell, is CallMessageCell, is InfoMessageCell:
|
||||||
self.viewModel.interactionData[indexPath.section].elements[indexPath.row]
|
return (
|
||||||
)
|
view.convert(cell.frame, from: tableView),
|
||||||
|
self.viewModel.interactionData[indexPath.section].elements[indexPath.row]
|
||||||
|
)
|
||||||
|
|
||||||
|
case is TypingIndicatorCell, is DateHeaderCell, is UnreadMarkerCell:
|
||||||
|
return nil
|
||||||
|
|
||||||
|
default:
|
||||||
|
SNLog("[ConversationVC] Warning: Processing unhandled cell type when marking as read, this could result in intermittent failures")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
})
|
})
|
||||||
// Exclude messages that are partially off the bottom of the screen
|
// Exclude messages that are partially off the bottom of the screen
|
||||||
.filter({ $0.frame.maxY <= tableVisualBottom })
|
.filter({ $0.frame.maxY <= tableVisualBottom })
|
||||||
|
|
Loading…
Reference in New Issue