don't self-report anon in slack

pull/4736/head
Thibault Duplessis 2018-11-30 15:40:12 +07:00
parent 9c37c10245
commit 60d5bcc820
2 changed files with 10 additions and 8 deletions

View File

@ -25,12 +25,14 @@ final class SelfReport(
lila.log("cheat").branch("jslog").info(
s"$ip https://lichess.org/$fullId ${user.fold("anon")(_.id)} $name"
)
slackApi.selfReport(
typ = name,
path = fullId,
user = user,
ip = ip
)
user ?? { u =>
slackApi.selfReport(
typ = name,
path = fullId,
user = u,
ip = ip
)
}
}
if (fullId == "________") fuccess(doLog)
else lila.game.GameRepo pov fullId map {

View File

@ -92,10 +92,10 @@ final class SlackApi(
channel = rooms.tavernBots
))
def selfReport(typ: String, path: String, user: Option[User], ip: IpAddress): Funit = client(SlackMessage(
def selfReport(typ: String, path: String, user: User, ip: IpAddress): Funit = client(SlackMessage(
username = "Self Report",
icon = "kms",
text = s"[*$typ*] ${user.fold("Anon")(userLink)}@$ip ${gameLink(path)}",
text = s"[*$typ*] ${userLink(user)}@$ip ${gameLink(path)}",
channel = rooms.tavernBots
))