public async Task AddMessage(ChadderMessage msg, ChadderConversation conversation) { conversation.Messages.Add(msg); await sqlDB.InsertAsync(msg); conversation.Hidden = false; await sqlDB.UpdateAsync(conversation); }
public async Task DeleteMessage(ChadderMessage msg, ChadderConversation conversation) { if (msg.Type == ChadderMessage.MESSAGE_TYPE.PICTURE) { await DeletePicture(msg.Picture); } await sqlDB.DeleteAsync(msg); conversation.Messages.Remove(msg); }