Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
 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;
 }
Ejemplo n.º 4
0
 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;
 }
Ejemplo n.º 5
0
 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)
 {
 }