public static ChadderContact Create(ContactInfo info, ChadderSource Source, bool isTemp = false)
        {
            var contact = new ChadderContact()
            {
                UserId      = info.Id,
                IsTemporary = isTemp
            };

            contact.Update(info, Source);
            return(contact);
        }
Esempio n. 2
0
        public async Task DeleteContact(ChadderContact contact)
        {
            var conversation = GetContactConversation(contact.UserId);

            await DeleteAllMessages(conversation);

            Conversations.Remove(conversation);
            await sqlDB.DeleteAsync(conversation);

            Contacts.Remove(contact);
            await sqlDB.DeleteAsync(contact);
        }
Esempio n. 3
0
        public async Task AddContact(ChadderContact contact, bool Hidden)
        {
            Contacts.Add(contact);
            await sqlDB.InsertAsync(contact);

            var conversation = new ChadderConversation()
            {
                ContactUserId = contact.UserId,
                Contact       = contact,
                Hidden        = Hidden,
            };
            await sqlDB.InsertAsync(conversation);

            Conversations.Add(conversation);
        }