Skip to content

Commit

Permalink
No insight for closed account
Browse files Browse the repository at this point in the history
  • Loading branch information
kraktus committed Jul 27, 2024
1 parent 5b01aa8 commit 5b0eced
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/insight/src/main/Share.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ final class Share(

def grant(insighted: User)(using to: Option[User]): Fu[Boolean] =
if to.exists(Granter.of(_.SeeInsight)) then fuTrue
else
else if insighted.enabled.yes
then
getPrefId(insighted).flatMap:
case _ if to.contains(insighted) => fuTrue
case lila.core.pref.InsightShare.EVERYBODY => fuTrue
case lila.core.pref.InsightShare.FRIENDS =>
to.so: t =>
relationApi.fetchAreFriends(insighted.id, t.id)
case lila.core.pref.InsightShare.NOBODY => fuFalse
else fuFalse

0 comments on commit 5b0eced

Please sign in to comment.