Ejemplo n.º 1
0
 public void MessageReadStateChanged(ChatUser mentionedUser, ChatMessage message, Notification notification)
 {
     foreach (var client in mentionedUser.ConnectedClients)
     {
         HubContext.Clients.Client(client.Id).messageReadStateChanged(message.Id, notification.Read);
     }
 }
Ejemplo n.º 2
0
        public void AddNotification(ChatUser mentionedUser, ChatMessage message, ChatRoom room, bool markAsRead)
        {
            // We need to use the key here since messages might be a new entity
            var notification = new Notification
            {
                User = mentionedUser,
                Message = message,
                Read = markAsRead,
                Room = room
            };

            _repository.Add(notification);
        }
Ejemplo n.º 3
0
 public void Add(Notification notification)
 {
     _notifications.Add(notification);
 }
Ejemplo n.º 4
0
 public void Remove(Notification notification)
 {
     _notifications.Remove(notification);
 }
Ejemplo n.º 5
0
 public void Remove(Notification notification)
 {
     _db.Notifications.Remove(notification);
     _db.SaveChanges();
 }
Ejemplo n.º 6
0
        public Notification AddNotification(ChatUser mentionedUser, ChatMessage message, ChatRoom room, bool markAsRead)
        {
            var notification = _repository.GetNotificationByMessage(message, mentionedUser);

            if (notification != null)
            {
                notification.Read = markAsRead;

                return notification;
            }

            // We need to use the key here since messages might be a new entity
            notification = new Notification
            {
                User = mentionedUser,
                Message = message,
                Read = markAsRead,
                Room = room
            };

            _repository.Add(notification);

            return notification;
        }
Ejemplo n.º 7
0
        public void AddNotification(ChatUser mentionedUser, ChatMessage message)
        {
            // We need to use the key here since messages might be a new entity
            var notification = new Notification
            {
                User = mentionedUser,
                Message = message
            };

            _repository.Add(notification);
        }
Ejemplo n.º 8
0
        public void SendAsync(Notification notification)
        {
            if (notification.Read) return;

            SendAsync(notification.User, notification.Message);
        }