projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
🎨 Replace future reply filter with Kotlin version
[Sone.git]
/
src
/
main
/
kotlin
/
net
/
pterodactylus
/
sone
/
data
/
Reply.kt
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
(file)
--- 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<Reply<*>> =
comparing(Reply<*>::getTime).reversed()
@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() }