Fix the monitor and make more useful titles and bodies
parent
eb75d46752
commit
edd2cae500
|
@ -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")()
|
||||
|
|
|
@ -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 =>
|
||||
|
|
Loading…
Reference in New Issue