only show public studies in activity
parent
021c75b6c4
commit
48061ec91c
|
@ -59,7 +59,7 @@ final class ActivityReadApi(
|
|||
simulApi byIds simuls.value.map(_.value) dmap some
|
||||
}
|
||||
studies <- a.studies ?? { studies =>
|
||||
studyApi idNames studies.value map some
|
||||
studyApi publicIdNames studies.value map some
|
||||
}
|
||||
view = ActivityView(
|
||||
games = a.games,
|
||||
|
|
|
@ -43,8 +43,8 @@ final class Env(
|
|||
case lila.hub.actorApi.plan.MonthInc(userId, months) => write.plan(userId, months)
|
||||
case lila.hub.actorApi.relation.Follow(from, to) => write.follow(from, to)
|
||||
case lila.study.actorApi.StartStudy(id) =>
|
||||
// wait 5 minutes in case the study turns private
|
||||
system.scheduler.scheduleOnce(5 seconds) { write study id }
|
||||
// wait some time in case the study turns private
|
||||
system.scheduler.scheduleOnce(5 minutes) { write study id }
|
||||
}
|
||||
})),
|
||||
'finishGame, 'forumPost, 'finishPuzzle, 'finishPractice,
|
||||
|
|
|
@ -33,7 +33,7 @@ final class StudyApi(
|
|||
|
||||
def byIds = studyRepo byOrderedIds _
|
||||
|
||||
def idNames = studyRepo idNames _
|
||||
def publicIdNames = studyRepo publicIdNames _
|
||||
|
||||
def publicByIds(ids: Seq[Study.Id]) = byIds(ids) map { _.filter(_.isPublic) }
|
||||
|
||||
|
|
|
@ -110,8 +110,8 @@ final class StudyRepo(private[study] val coll: Coll) {
|
|||
|
||||
private val idNameProjection = $doc("name" -> true)
|
||||
|
||||
def idNames(ids: List[Study.Id]): Fu[List[Study.IdName]] =
|
||||
coll.find($inIds(ids), idNameProjection).list[Study.IdName]()
|
||||
def publicIdNames(ids: List[Study.Id]): Fu[List[Study.IdName]] =
|
||||
coll.find($inIds(ids) ++ selectPublic, idNameProjection).list[Study.IdName]()
|
||||
|
||||
def recentByOwner(userId: User.ID, nb: Int) =
|
||||
coll.find(
|
||||
|
|
Loading…
Reference in New Issue