🎨 Replace future reply filter with Kotlin version
[Sone.git] / src / main / kotlin / net / pterodactylus / sone / data / Reply.kt
index 9a3ec64..cfc940a 100644 (file)
@@ -25,3 +25,10 @@ import java.util.Comparator.comparing
 @get:JvmName("newestReplyFirst")
 val newestReplyFirst: Comparator<Reply<*>> =
                comparing(Reply<*>::getTime).reversed()
+
+/**
+ * Predicate that returns whether a reply is _not_ from the future,
+ * i.e. whether it should be visible now.
+ */
+val noFutureReply: (Reply<*>) -> Boolean =
+               { it.getTime() <= System.currentTimeMillis() }