2013-04-03 11:12:38 -06:00
|
|
|
package lila.team
|
|
|
|
|
2016-06-03 03:43:20 -06:00
|
|
|
import lila.notify.Notification.Notifies
|
2018-07-05 15:19:20 -06:00
|
|
|
import lila.notify.TeamJoined.{ Id => TJId, Name => TJName }
|
2020-04-23 17:47:20 -06:00
|
|
|
import lila.notify.{ Notification, NotifyApi, TeamJoined }
|
2013-04-03 11:12:38 -06:00
|
|
|
|
2019-12-13 07:30:20 -07:00
|
|
|
final private[team] class Notifier(notifyApi: NotifyApi) {
|
2013-04-03 11:12:38 -06:00
|
|
|
|
2016-06-03 03:43:20 -06:00
|
|
|
def acceptRequest(team: Team, request: Request) = {
|
2018-07-05 15:19:20 -06:00
|
|
|
val notificationContent = TeamJoined(TJId(team.id), TJName(team.name))
|
2019-12-13 07:30:20 -07:00
|
|
|
val notification = Notification.make(Notifies(request.user), notificationContent)
|
2013-04-03 11:12:38 -06:00
|
|
|
|
2016-06-03 03:43:20 -06:00
|
|
|
notifyApi.addNotification(notification)
|
2013-04-03 11:12:38 -06:00
|
|
|
}
|
|
|
|
}
|