private fun getLastSeenMessagePosition(lastSeenMessage: Message?): Int { if (lastSeenMessage == null) return 0  return currentMessagesState.messageItems.indexOfFirst { it is MessageItemState && it.message.id == lastSeenMessage.id } }
Gets the list position of the last seen message in the list.