public void WithNewConversation(Conversation conversation) { if (NewConversations.Any(t => t.Id == conversation.Id)) { return; } NewConversations.Add(conversation); }
private async Task NotifyNewConversations(int siteId) { foreach (var newConversation in NewConversations) { await _notificationManager.NotifyNewConversation(siteId, newConversation.Id); } NewConversations.Clear(); }
public void WithNewMessage(Message message) { if (NewConversations.Any(t => t.Id == message.ConversationId)) { return; } if (NewMessages.Any(t => t.Id == message.Id)) { return; } NewMessages.Add(message); }
public void WithUpdatedConversation(Conversation conversation) { if (NewConversations.Any(t => t.Id == conversation.Id)) { return; } if (UpdatedConversations.Any(t => t.Id == conversation.Id)) { return; } UpdatedConversations.Add(conversation); }