X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fdata%2FReply.kt;h=cfc940a20946faf38619f0fb42ccc3f2ee9fa938;hp=9a3ec6454c9512aa21b4e24060e85e41654061e2;hb=0ace0221fc20ef93457b8c62c6ac12286c1aa12c;hpb=f049280a40ddf05f02400e7f0d93a24dea4545c2 diff --git a/src/main/kotlin/net/pterodactylus/sone/data/Reply.kt b/src/main/kotlin/net/pterodactylus/sone/data/Reply.kt index 9a3ec64..cfc940a 100644 --- a/src/main/kotlin/net/pterodactylus/sone/data/Reply.kt +++ b/src/main/kotlin/net/pterodactylus/sone/data/Reply.kt @@ -25,3 +25,10 @@ import java.util.Comparator.comparing @get:JvmName("newestReplyFirst") val newestReplyFirst: Comparator> = 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() }