public InAppNotificationProvider(ISceneHost scene, ISerializer serializer, ILogger logger, IConfiguration configuration, IUserSessions userSessions, InAppNotificationRepository repository)
        {
            _scene          = scene;
            this.serializer = serializer;
            _logger         = logger;
            _repository     = repository;

            configuration.SettingsChanged += (_, settings) => ApplyConfig(settings);
            ApplyConfig(configuration.Settings);

            _userSessions = userSessions;


            _scene.Connected.Add(OnConnected);

            _scene.AddProcedure("inappnotification.acknowledgenotification", async(RequestContext <IScenePeerClient> ctx) =>
            {
                var notificationId = ctx.ReadObject <string>();

                if (string.IsNullOrEmpty(notificationId))
                {
                    throw new ClientException("Bad notificationId.");
                }

                await AcknowledgeNotification(notificationId);
            });
        }
Пример #2
0
 public InAppNotificationsAdminController(INotificationChannel notificationChannel, IUserSessions sessions, InAppNotificationRepository repository, ILogger logger)
 {
     _notificationChannel = notificationChannel;
     _sessions            = sessions;
     _repository          = repository;
     _logger = logger;
 }