     # TODO: Get prefs to sync
     if classname is PREF
       id = 1
-      changes = @settingsValidate(changes)
 
     else
       id = changes.id

    index = tasks.indexOf oldId
    if index > -1
      tasks.spice index, 1, newId
      @user.updateModel LIST, listId, tasks:tasks


  # -------------------
  # Settings Validation
  # -------------------

  settingsValidate: (settings) ->
    allowed = ['sort', 'weekStart', 'dateFormat', 'completedDuration',
               'confirmDelete', 'night', 'language', 'notifications',
               'notifyEmail', 'notifyTime', 'notifyRegular']
    out = {}
    for property in allowed
      if settings.hasOwnProperty(property)
        out[property] = settings[property]
    return out


  # --------------------
  # Miscellaneous events
  # --------------------

  ###*
   * Send a users list to an email address
   * @param {integer} uid: a user ID
   * @param {string} listId: a list ID
   * @param {string} email: an email address
   * @return {boolean} false: if error
  ###
  emailList: (data) ->
    return false unless Array.isArray(data)
    [uid, listId, email] = data
    require('./todo.html')(uid, listId)
      .then ([data, user]) ->
        listName = user.data(LIST)[listId]?.name
        options =
          to: email
          replyTo: user.email
          from: "#{ user.name } <hello@nitrotasks.com>"
          subject: "I've sent you my #{ listName } list"
          html: data
          generateTextFromHTML: true
        console.log options
        require('./mail').send(options)
      .fail (error) ->
        console.warn error

module.exports = Sync

    index = tasks.indexOf taskId
    if index > -1
      tasks.splice index, 1
      @user.save LIST

  # Move a task from list to another
  taskMove: (taskId, oldListId, newListId) ->
