private fun shouldAddDateSeparator(previousMessage: Message?, message: Message): Boolean { return if (!showDateSeparators) { false } else if (previousMessage == null) { true } else { val timeDifference = message.getCreatedAtOrThrow().time - previousMessage.getCreatedAtOrThrow().time  return timeDifference > dateSeparatorThresholdMillis } }
Decides if we need to add a date separator or not.