Fix the monitor and make more useful titles and bodies

pull/2315/head
Mark Henle 2016-10-17 19:26:49 -04:00
parent eb75d46752
commit edd2cae500
2 changed files with 5 additions and 4 deletions

View File

@ -317,6 +317,7 @@ object mon {
object send {
def move(platform: String) = inc(s"push.send.$platform.move")()
def finish(platform: String) = inc(s"push.send.$platform.finish")()
def message(platform: String) = inc(s"push.send.$platform.message")()
object challenge {
def create(platform: String) = inc(s"push.send.$platform.challenge_create")()
def accept(platform: String) = inc(s"push.send.$platform.challenge_accept")()

View File

@ -73,11 +73,11 @@ private final class PushApi(
}
def newMessage(t: Thread, p: Post): Funit =
pushToAll(t.receiverOf(p), _.challenge.create, PushApi.Data(
title = s"New message from ${t.senderOf(p)}",
body = t.receiverOf(p),
pushToAll(t.receiverOf(p), _.message, PushApi.Data(
title = s"${t.senderOf(p)}: ${t.name}",
body = p.text,
payload = Json.obj("threadId" -> t.id)))
def challengeCreate(c: Challenge): Funit = c.destUser ?? { dest =>
c.challengerUser.ifFalse(c.hasClock) ?? { challenger =>