send appeals to zulip, more zulip tweaks
parent
b16a0458a1
commit
d290aaad09
|
@ -121,8 +121,8 @@ final class Appeal(env: Env, reportC: => Report, prismicC: => Prismic, userC: =>
|
|||
}
|
||||
}
|
||||
|
||||
def notifySlack(username: String) =
|
||||
Secure(_.NotifySlack) { implicit ctx => me =>
|
||||
def sendToZulip(username: String) =
|
||||
Secure(_.SendToZulip) { implicit ctx => me =>
|
||||
asMod(username) { (appeal, suspect) =>
|
||||
env.irc.api.userAppeal(user = suspect.user, mod = me) inject NoContent
|
||||
}
|
||||
|
|
|
@ -211,7 +211,7 @@ final class Mod(
|
|||
}
|
||||
|
||||
def notifySlack(username: String) =
|
||||
OAuthMod(_.NotifySlack) { _ => me =>
|
||||
OAuthMod(_.SendToZulip) { _ => me =>
|
||||
withSuspect(username) { sus =>
|
||||
env.irc.api.userMod(user = sus.user, mod = me) map some
|
||||
}
|
||||
|
|
|
@ -64,10 +64,10 @@ object discussion {
|
|||
case Some(Inquiry(mod, _)) => frag(userIdLink(mod.some), nbsp, "is handling this.")
|
||||
},
|
||||
postForm(
|
||||
action := routes.Appeal.notifySlack(modData.suspect.user.id),
|
||||
action := routes.Appeal.sendToZulip(modData.suspect.user.id),
|
||||
cls := "appeal__actions__slack"
|
||||
)(
|
||||
submitButton(cls := "button button-thin")("Send to slack")
|
||||
submitButton(cls := "button button-thin")("Send to Zulip")
|
||||
)
|
||||
)
|
||||
)
|
||||
|
|
|
@ -203,7 +203,7 @@ object inquiry {
|
|||
div(cls := "dropper more buttons")(
|
||||
iconTag(""),
|
||||
div(
|
||||
isGranted(_.NotifySlack) option {
|
||||
isGranted(_.SendToZulip) option {
|
||||
postForm(action := routes.Mod.notifySlack(in.user.id))(
|
||||
submitButton(cls := "fbt")("Notify Slack")
|
||||
)
|
||||
|
|
|
@ -62,9 +62,9 @@ object mod {
|
|||
title := "View communications"
|
||||
)("Comms")
|
||||
},
|
||||
isGranted(_.NotifySlack) option {
|
||||
isGranted(_.SendToZulip) option {
|
||||
postForm(action := routes.Mod.notifySlack(u.id), title := "Notify #tavern", cls := "xhr")(
|
||||
submitButton(cls := "btn-rack__btn")("Slack")
|
||||
submitButton(cls := "btn-rack__btn")("Zulip")
|
||||
)
|
||||
}
|
||||
),
|
||||
|
|
|
@ -605,7 +605,7 @@ GET /appeal/:username controllers.Appeal.show(username: String)
|
|||
POST /appeal/:username controllers.Appeal.reply(username: String)
|
||||
POST /appeal/:username/mute controllers.Appeal.mute(username: String)
|
||||
POST /appeal/:username/snooze/:dur controllers.Appeal.snooze(username: String, dur: String)
|
||||
POST /appeal/:username/notify-slack controllers.Appeal.notifySlack(username: String)
|
||||
POST /appeal/:username/send-to-zulip controllers.Appeal.sendToZulip(username: String)
|
||||
|
||||
# Stats
|
||||
GET /stat/rating/distribution/:perf controllers.Stat.ratingDistribution(perf: String)
|
||||
|
|
|
@ -172,7 +172,7 @@ final class IrcApi(
|
|||
text = s"${slackdown.broadcastLink(id, name)}: $error",
|
||||
channel = SlackClient.rooms.broadcast
|
||||
)
|
||||
) >> zulip(_.broadcast, "main")(s":lightning: ${markdown.broadcastLink(id, name)}: $error")
|
||||
) >> zulip(_.broadcast, "lila error log")(s"${markdown.broadcastLink(id, name)} $error")
|
||||
|
||||
def userAppeal(user: User, mod: Holder): Funit =
|
||||
slack(
|
||||
|
|
|
@ -21,7 +21,7 @@ object Permission {
|
|||
case object GamifyView extends Permission("GAMIFY_VIEW", "See mod leaderboard")
|
||||
case object UserModView extends Permission("USER_SPY", "User profile mod view")
|
||||
case object UserEvaluate extends Permission("USER_EVALUATE", "Request evaluation")
|
||||
case object NotifySlack extends Permission("NOTIFY_SLACK", List(UserModView), "Notify #tavern")
|
||||
case object SendToZulip extends Permission("NOTIFY_SLACK", List(UserModView), "Send to Zulip")
|
||||
case object ViewPrivateComms extends Permission("VIEW_PRIVATE_COMS", "View private comms")
|
||||
case object Shadowban extends Permission("SHADOWBAN", List(UserModView, ChatTimeout), "Shadowban")
|
||||
case object SetKidMode extends Permission("SET_KID_MODE", List(UserModView), "Set Kid Mode")
|
||||
|
@ -147,7 +147,7 @@ object Permission {
|
|||
ManageTournament,
|
||||
ManageSimul,
|
||||
ManageEvent,
|
||||
NotifySlack,
|
||||
SendToZulip,
|
||||
PracticeConfig,
|
||||
PuzzleCurator,
|
||||
Presets,
|
||||
|
|
Loading…
Reference in New Issue