don't notify kids about new blog posts
This commit is contained in:
parent
fd96570599
commit
c3d4c592e2
|
@ -18,7 +18,7 @@ private[blog] final class Notifier(
|
|||
_ ?? { post =>
|
||||
ThreadRepo.visibleByUserContainingExists(user = lichessUserId, containing = post.id) foreach {
|
||||
case true => funit
|
||||
case false => UserRepo recentlySeenIds DateTime.now.minusWeeks(2) foreach { userIds =>
|
||||
case false => UserRepo recentlySeenNotKidIds DateTime.now.minusWeeks(2) foreach { userIds =>
|
||||
(ThreadRepo reallyDeleteByCreatorId lichessUserId) >> {
|
||||
val thread = makeThread(post)
|
||||
val futures = userIds.toStream map { userId =>
|
||||
|
|
|
@ -281,10 +281,11 @@ trait UserRepo {
|
|||
$update.fieldUnchecked(id, "seenAt", $date(DateTime.now))
|
||||
}
|
||||
|
||||
def recentlySeenIds(since: DateTime) =
|
||||
def recentlySeenNotKidIds(since: DateTime) =
|
||||
$primitive(enabledSelect ++ Json.obj(
|
||||
"seenAt" -> $gt($date(since)),
|
||||
"count.game" -> $gt(4)
|
||||
"count.game" -> $gt(4),
|
||||
"kid" -> $ne(true)
|
||||
), "_id")(_.asOpt[String])
|
||||
|
||||
def setLang(id: ID, lang: String) = $update.field(id, "lang", lang)
|
||||
|
|
Loading…
Reference in a new issue