fix scapegoat warnings
parent
31db5a0086
commit
9de25c389d
|
@ -25,10 +25,9 @@ object inquiry {
|
|||
})
|
||||
|
||||
def apply(in: lila.mod.Inquiry)(implicit ctx: Context) = {
|
||||
|
||||
def renderReport(r: lila.report.Report) =
|
||||
div(cls := "doc report")(
|
||||
r.bestAtoms(10).toList.map { atom =>
|
||||
r.bestAtoms(10).map { atom =>
|
||||
div(cls := "atom")(
|
||||
h3(
|
||||
reportScore(atom.score),
|
||||
|
|
|
@ -12,9 +12,7 @@ final class CategApi(env: Env) {
|
|||
views <- (categs map { categ =>
|
||||
env.postApi get (categ lastPostId troll) map { topicPost =>
|
||||
CategView(categ, topicPost map {
|
||||
_ match {
|
||||
case (topic, post) => (topic, post, env.postApi lastPageOf topic)
|
||||
}
|
||||
case (topic, post) => (topic, post, env.postApi lastPageOf topic)
|
||||
}, troll)
|
||||
}
|
||||
}).sequenceFu
|
||||
|
|
|
@ -109,6 +109,6 @@ private final class Biter(
|
|||
(seek.perfType map user.ratingAt) ?? range.contains
|
||||
}
|
||||
|
||||
final def showHookTo(hook: Hook, member: LobbySocket.Member): Boolean =
|
||||
def showHookTo(hook: Hook, member: LobbySocket.Member): Boolean =
|
||||
hook.sri == member.sri || canJoin(hook, member.user)
|
||||
}
|
||||
|
|
|
@ -40,8 +40,6 @@ object Color {
|
|||
|
||||
val all = List(White, Black, Random)
|
||||
|
||||
def random = all(scala.util.Random.nextInt(all.size))
|
||||
|
||||
val names = all map (_.name)
|
||||
|
||||
val choices = names zip names
|
||||
|
|
|
@ -54,7 +54,7 @@ final class SeekApi(
|
|||
}
|
||||
|
||||
private def noDupsFor(user: LobbyUser, seeks: List[Seek]) =
|
||||
seeks.foldLeft(List[Seek]() -> Set[String]()) {
|
||||
seeks.foldLeft(List.empty[Seek] -> Set.empty[String]) {
|
||||
case ((res, h), seek) if seek.user.id == user.id => (seek :: res, h)
|
||||
case ((res, h), seek) =>
|
||||
val seekH = List(seek.variant, seek.daysPerTurn, seek.mode, seek.color, seek.user.id) mkString ","
|
||||
|
|
|
@ -157,7 +157,7 @@ final class PlaybanApi(
|
|||
def hasCurrentBan(userId: User.ID): Fu[Boolean] = currentBan(userId).map(_.isDefined)
|
||||
|
||||
def completionRate(userId: User.ID): Fu[Option[Double]] =
|
||||
coll.primitiveOne[List[Outcome]]($id(userId), "o").map(~_) map { outcomes =>
|
||||
coll.primitiveOne[Vector[Outcome]]($id(userId), "o").map(~_) map { outcomes =>
|
||||
outcomes.collect {
|
||||
case Outcome.RageQuit | Outcome.Sitting | Outcome.NoPlay | Outcome.Abort => false
|
||||
case Outcome.Good => true
|
||||
|
|
|
@ -9,14 +9,14 @@ import lila.game.Game
|
|||
|
||||
case class UserRecord(
|
||||
_id: String,
|
||||
o: Option[List[Outcome]],
|
||||
b: Option[List[TempBan]],
|
||||
o: Option[Vector[Outcome]],
|
||||
b: Option[Vector[TempBan]],
|
||||
c: Option[RageSit]
|
||||
) {
|
||||
|
||||
def userId = _id
|
||||
def outcomes: List[Outcome] = ~o
|
||||
def bans: List[TempBan] = ~b
|
||||
def outcomes: Vector[Outcome] = ~o
|
||||
def bans: Vector[TempBan] = ~b
|
||||
def rageSit = c | RageSit.empty
|
||||
|
||||
def banInEffect = bans.lastOption.exists(_.inEffect)
|
||||
|
@ -99,7 +99,7 @@ object TempBan {
|
|||
* - >3 days quick drop off
|
||||
* Account less than 3 days old --> 2x the usual time
|
||||
*/
|
||||
def make(bans: List[TempBan], accountCreationDate: DateTime): TempBan = make {
|
||||
def make(bans: Vector[TempBan], accountCreationDate: DateTime): TempBan = make {
|
||||
(bans.lastOption ?? { prev =>
|
||||
prev.endsAt.toNow.getStandardHours.truncInt match {
|
||||
case h if h < 72 => prev.mins * (132 - h) / 60
|
||||
|
|
|
@ -117,7 +117,7 @@ private[relation] final class RelationActor(
|
|||
) =
|
||||
friendsEntering foreach { entering =>
|
||||
api fetchFollowersFromSecondary entering.user.id map onlineUserIds.intersect foreach { ids =>
|
||||
if (ids.nonEmpty) Bus.publish(SendTos(ids.toSet, JsonView.writeFriendEntering(entering)), "socketUsers")
|
||||
if (ids.nonEmpty) Bus.publish(SendTos(ids, JsonView.writeFriendEntering(entering)), "socketUsers")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -127,19 +127,19 @@ private[relation] final class RelationActor(
|
|||
) =
|
||||
friendsLeaving foreach { leaving =>
|
||||
api fetchFollowersFromSecondary leaving.id map onlineUserIds.intersect foreach { ids =>
|
||||
if (ids.nonEmpty) Bus.publish(SendTos(ids.toSet, "following_leaves", leaving.titleName), "socketUsers")
|
||||
if (ids.nonEmpty) Bus.publish(SendTos(ids, "following_leaves", leaving.titleName), "socketUsers")
|
||||
}
|
||||
}
|
||||
|
||||
private def notifyFollowersGameStateChanged(userIds: Iterable[ID], message: String) =
|
||||
userIds foreach { userId =>
|
||||
api.fetchFollowersFromSecondary(userId) map online.userIds().intersect foreach { ids =>
|
||||
if (ids.nonEmpty) Bus.publish(SendTos(ids.toSet, message, userId), "socketUsers")
|
||||
if (ids.nonEmpty) Bus.publish(SendTos(ids, message, userId), "socketUsers")
|
||||
}
|
||||
}
|
||||
|
||||
private def notifyFollowersFriendInStudyStateChanged(userId: ID, message: String) =
|
||||
api.fetchFollowersFromSecondary(userId) map online.userIds().intersect foreach { ids =>
|
||||
if (ids.nonEmpty) Bus.publish(SendTos(ids.toSet, message, userId), "socketUsers")
|
||||
if (ids.nonEmpty) Bus.publish(SendTos(ids, message, userId), "socketUsers")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue