From 69f179219daf57cc7c4bfcbe54e3f33e20c95aa9 Mon Sep 17 00:00:00 2001 From: Thibault Duplessis Date: Mon, 5 Jul 2021 08:01:19 +0200 Subject: [PATCH] tweak zulip messages --- .../src/main/PlayerAggregateAssessment.scala | 6 +++--- modules/irc/src/main/IrcApi.scala | 17 ++++++++++------- .../security/src/main/GarbageCollector.scala | 2 +- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/modules/evaluation/src/main/PlayerAggregateAssessment.scala b/modules/evaluation/src/main/PlayerAggregateAssessment.scala index a9410efbb0..12d112005a 100644 --- a/modules/evaluation/src/main/PlayerAggregateAssessment.scala +++ b/modules/evaluation/src/main/PlayerAggregateAssessment.scala @@ -116,13 +116,13 @@ case class PlayerAggregateAssessment( .sortBy(-_.assessment.id) .take(maxGames) .map { a => - a.assessment.emoticon + " lichess.org/" + a.gameId + "/" + a.color.name + s" ${a.assessment.emoticon} lichess.org/${a.gameId}/${a.color.name}" } .mkString("\n") s"""Cheating Games: $cheatingSum (weighted: $weightedCheatingSum) - Likely Cheating Games: $likelyCheatingSum (weighted: $weightedLikelyCheatingSum) - $gameLinks""" +Likely Cheating Games: $likelyCheatingSum (weighted: $weightedLikelyCheatingSum) +$gameLinks""" } } diff --git a/modules/irc/src/main/IrcApi.scala b/modules/irc/src/main/IrcApi.scala index 2df544520c..4ae4f29430 100644 --- a/modules/irc/src/main/IrcApi.scala +++ b/modules/irc/src/main/IrcApi.scala @@ -50,7 +50,7 @@ final class IrcApi( channel = SlackClient.rooms.tavern ) ) >> zulip(_.mod.hunterCheat, user.username)( - s"${markdown.userLink(mod.user.username)} :note: **${markdown + s"${markdown.modLink(mod.user.username)} :note: **${markdown .userLink(user.username)}** (${markdown.userNotesLink(user.username)}):\n" + markdown.linkifyUsers(note.text take 2000) ) @@ -67,7 +67,7 @@ final class IrcApi( ) ) >> zulip(_.mod.adminLog, "notes")( - s":note: ${markdown.userLink(modName)} **${markdown.userLink(username)}** (${markdown.userNotesLink(username)}):\n" + + s"${markdown.modLink(modName)} :note: **${markdown.userLink(username)}** (${markdown.userNotesLink(username)}):\n" + markdown.linkifyUsers(note take 2000) ) @@ -80,7 +80,7 @@ final class IrcApi( channel = SlackClient.rooms.tavernBots ) ) >> zulip(_.mod.log, "self report")( - s"[*$typ*] ${markdown.userLink(user)}@$ip ${markdown.gameLink(path)}" + s"[**$typ**] ${markdown.userLink(user)}@$ip ${markdown.gameLink(path)}" ) def commlog(mod: Holder, user: User, reportBy: Option[User.ID]): Funit = @@ -98,7 +98,7 @@ final class IrcApi( ) ) >> zulip(_.mod.adminLog, "private comms checks")({ val finalS = if (user.username endsWith "s") "" else "s" - s"**${markdown userLink mod.user.username}** checked out **${markdown userLink user.username}**'$finalS communications " + s"**${markdown modLink mod.user.username}** checked out **${markdown userLink user.username}**'$finalS communications " } + reportBy.filter(mod.id !=).fold("spontaneously") { by => s"while investigating a report created by ${markdown.userLink(by)}" }) @@ -133,7 +133,7 @@ final class IrcApi( ) ) >> zulip(_.mod.log, "actions")( - s"${markdown.userLink(modId)} :$icon: ${markdown.linkifyUsers(text)}" + s"${markdown.modLink(modId)} :$icon: ${markdown.linkifyUsers(text)}" ) } } @@ -151,7 +151,7 @@ final class IrcApi( channel = SlackClient.rooms.tavern ) ) >> zulip(_.mod.log, "chat panic")( - s":stop: ${if (v) "Enabled" else "Disabled"} ${markdown.lichessLink("mod/chat-panic", " Chat Panic")}" + s":stop: ${markdown.modLink(mod.user)} ${if (v) "enabled" else "disabled"} ${markdown.lichessLink("mod/chat-panic", " Chat Panic")}" ) def garbageCollector(msg: String): Funit = @@ -184,7 +184,8 @@ final class IrcApi( channel = SlackClient.rooms.tavernAppeal ) ) >> zulip(_.mod.adminAppeal, user.username)( - s"Let's have a look at the appeal of _*${markdown.lichessLink(s"/appeal/${user.username}", user.username)}*_" + s"${markdown.modLink(mod.user)} :eyes: Let's have a look at the appeal of _*${markdown + .lichessLink(s"/appeal/${user.username}", user.username)}*_" ) def stop(): Funit = @@ -296,6 +297,8 @@ object IrcApi { def lichessLink(path: String, name: String) = s"[$name](https://lichess.org$path)" def userLink(name: String): String = lichessLink(s"/@/$name?mod", name) def userLink(user: User): String = userLink(user.username) + def modLink(name: String): String = lichessLink(s"/@/$name", name) + def modLink(user: User): String = modLink(user.username) def gameLink(id: String) = lichessLink(s"/$id", s"#$id") def userNotesLink(name: String) = lichessLink(s"/@/$name?notes", "notes") def broadcastLink(id: String, name: String) = lichessLink(s"/broadcast/-/$id", name) diff --git a/modules/security/src/main/GarbageCollector.scala b/modules/security/src/main/GarbageCollector.scala index e5df9fcea8..1bb5de3766 100644 --- a/modules/security/src/main/GarbageCollector.scala +++ b/modules/security/src/main/GarbageCollector.scala @@ -68,7 +68,7 @@ final class GarbageCollector( "userSignup" ) printOpt.filter(_.banned).map(_.fp.value) match { - case Some(print) => collect(user, email, msg = s"Print ban: ${print.value}") + case Some(print) => collect(user, email, msg = s"Print ban: `${print.value}`") case _ => badOtherAccounts(spy.otherUsers.map(_.user)) ?? { others => logger.debug(s"other ${data.user.username} others=${others.map(_.username)}")