2016-05-30 06:51:36 -06:00
|
|
|
package controllers
|
|
|
|
|
|
|
|
import lila.app._
|
|
|
|
import lila.notify.Notification.Notifies
|
|
|
|
|
|
|
|
import play.api.libs.json._
|
|
|
|
|
2019-12-04 16:39:16 -07:00
|
|
|
final class Notify(env: Env) extends LilaController(env) {
|
2016-05-30 06:51:36 -06:00
|
|
|
|
2019-12-05 08:46:00 -07:00
|
|
|
import env.notifyM.jsonHandlers._
|
2016-05-31 14:54:05 -06:00
|
|
|
|
2020-05-05 22:11:15 -06:00
|
|
|
def recent(page: Int) =
|
|
|
|
Auth { implicit ctx => me =>
|
|
|
|
XhrOrRedirectHome {
|
|
|
|
val notifies = Notifies(me.id)
|
|
|
|
env.notifyM.api.getNotificationsAndCount(notifies, page) map { res =>
|
|
|
|
Ok(Json toJson res) as JSON
|
|
|
|
}
|
2017-03-24 05:06:54 -06:00
|
|
|
}
|
2017-02-14 08:34:07 -07:00
|
|
|
}
|
2016-05-30 06:51:36 -06:00
|
|
|
}
|