2016-05-30 06:51:36 -06:00
|
|
|
package controllers
|
|
|
|
|
|
|
|
import lila.app._
|
|
|
|
import lila.notify.Notification.Notifies
|
|
|
|
|
2019-12-04 16:39:16 -07:00
|
|
|
final class Notify(env: Env) extends LilaController(env) {
|
2016-05-30 06:51:36 -06:00
|
|
|
|
2020-05-05 22:11:15 -06:00
|
|
|
def recent(page: Int) =
|
|
|
|
Auth { implicit ctx => me =>
|
|
|
|
XhrOrRedirectHome {
|
2021-04-07 03:11:36 -06:00
|
|
|
env.notifyM.api
|
|
|
|
.getNotificationsAndCount(Notifies(me.id), page) map env.notifyM.jsonHandlers.apply map JsonOk
|
2021-03-26 14:54:26 -06:00
|
|
|
}
|
2017-02-14 08:34:07 -07:00
|
|
|
}
|
2021-09-26 09:10:22 -06:00
|
|
|
|
2021-09-29 08:10:37 -06:00
|
|
|
def clear = Auth { implicit ctx => me =>
|
|
|
|
env.notifyM.api.remove(Notifies(me.id))
|
|
|
|
}
|
2016-05-30 06:51:36 -06:00
|
|
|
}
|