diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-04-25 16:15:50 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-04-25 16:15:50 -0400 |
| commit | 547291f04865f23090986667b5a802cd89ea003d (patch) | |
| tree | ff2e4c105979fea94390af6c3614193a0d2a9dc5 /MediaBrowser.Server.Implementations/Notifications/InternalNotificationService.cs | |
| parent | eda8159b4408c4b33cbdd56e3e6ed2f82757bb0c (diff) | |
rework notifications infrastructure
Diffstat (limited to 'MediaBrowser.Server.Implementations/Notifications/InternalNotificationService.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Notifications/InternalNotificationService.cs | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/MediaBrowser.Server.Implementations/Notifications/InternalNotificationService.cs b/MediaBrowser.Server.Implementations/Notifications/InternalNotificationService.cs new file mode 100644 index 000000000..56cb52f10 --- /dev/null +++ b/MediaBrowser.Server.Implementations/Notifications/InternalNotificationService.cs @@ -0,0 +1,42 @@ +using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Notifications; +using MediaBrowser.Model.Notifications; +using System.Threading; +using System.Threading.Tasks; + +namespace MediaBrowser.Server.Implementations.Notifications +{ + public class InternalNotificationService : INotificationService + { + private readonly INotificationsRepository _repo; + + public InternalNotificationService(INotificationsRepository repo) + { + _repo = repo; + } + + public string Name + { + get { return "Dashboard Notifications"; } + } + + public Task SendNotification(UserNotification request, CancellationToken cancellationToken) + { + return _repo.AddNotification(new Notification + { + Date = request.Date, + Description = request.Description, + Level = request.Level, + Name = request.Name, + Url = request.Url, + UserId = request.User.Id.ToString("N") + + }, cancellationToken); + } + + public bool IsEnabledForUser(User user) + { + return true; + } + } +} |
