public async Task CreateChat(string name, ChatPrivacyMode privacyMode, params Guid[] userIds) { var chatId = await _dotChat.Chats.Add(_userId, null, new ChatInfo(name, $"{name} description", privacyMode, 0), new ParticipationCandidates(userIds.Concat(Enumerable.Repeat(_userId, 1)) .Select(r => new ParticipationCandidate(r, ChatParticipantType.Participant)).ToList(), new List <ParticipationCandidate>())); _chatIds.TryAdd(name, chatId); }
public ChatInfo(string name, string description, ChatPrivacyMode privacyMode, long version, string style = null, string metadata = null) { Name = name; Description = description; PrivacyMode = privacyMode; Version = version; Style = style; Metadata = metadata; }
public Chat(string name, string description, ChatPrivacyMode privacyMode, long version, Guid chatId, TChatParticipantCollection participants, DateTime lastTimestamp, long topIndex, Guid?lastMessageId, Guid?lastMessageAuthorId, TChatMessageInfo lastChatMessageInfo, string style = null, string metadata = null) : base(name, description, privacyMode, version, style, metadata) { ChatId = chatId; Participants = participants; LastTimestamp = lastTimestamp; TopIndex = topIndex; LastMessageId = lastMessageId; LastMessageAuthorId = lastMessageAuthorId; LastChatMessageInfo = lastChatMessageInfo; }
public PersonalizedChat(string name, string description, ChatPrivacyMode privacyMode, long version, Guid chatId, TChatParticipantCollection participants, DateTime lastTimestamp, long topIndex, Guid?lastMessageId, Guid?lastMessageAuthorId, TChatMessageInfo lastChatMessageInfo, long readIndex, long unreadCount) : base(name, description, privacyMode, version, chatId, participants, lastTimestamp, topIndex, lastMessageId, lastMessageAuthorId, lastChatMessageInfo) { ReadIndex = readIndex; UnreadCount = unreadCount; }
public Chat(string name, string description, ChatPrivacyMode privacyMode, long version, Guid chatId, List <ChatParticipant> participants, DateTime lastTimestamp, long topIndex, Guid?lastMessageId, Guid?lastMessageAuthorId, ChatMessageInfo lastChatMessageInfo) : base(name, description, privacyMode, version, chatId, participants, lastTimestamp, topIndex, lastMessageId, lastMessageAuthorId, lastChatMessageInfo) { }