tweak hook compatibility function
This commit is contained in:
parent
1a0ab4278c
commit
b24cded1dc
|
@ -34,7 +34,9 @@ case class Hook(
|
|||
def memberOnly = !allowAnon
|
||||
|
||||
def compatibleWith(h: Hook) =
|
||||
compatibilityProperties == h.compatibilityProperties &&
|
||||
mode == h.mode &&
|
||||
variant == h.variant &&
|
||||
clock == h.clock &&
|
||||
(realColor compatibleWith h.realColor) &&
|
||||
(memberOnly || h.memberOnly).fold(isAuth && h.isAuth, true) &&
|
||||
ratingRangeCompatibleWith(h) && h.ratingRangeCompatibleWith(this) &&
|
||||
|
@ -44,8 +46,6 @@ case class Hook(
|
|||
range => h.rating ?? range.contains
|
||||
}
|
||||
|
||||
private def compatibilityProperties = (variant, clock.limit, clock.increment, mode)
|
||||
|
||||
lazy val realRatingRange: Option[RatingRange] = RatingRange noneIfDefault ratingRange
|
||||
|
||||
def userId = user.map(_.id)
|
||||
|
|
Loading…
Reference in a new issue