'use strict'; var async = require('async'), meta = require('../meta'), db = require('../database'), plugins = require('../plugins'); module.exports = function(User) { User.getSettings = function(uid, callback) { if (!parseInt(uid, 10)) { return onSettingsLoaded(0, {}, callback); } db.getObject('user:' + uid + ':settings', function(err, settings) { if (err) { return callback(err); } onSettingsLoaded(uid, settings ? settings : {}, callback); }); }; User.getMultipleUserSettings = function(uids, callback) { if (!Array.isArray(uids) || !uids.length) { return callback(null, []); } var keys = uids.map(function(uid) { return 'user:' + uid + ':settings'; }); db.getObjects(keys, function(err, settings) { if (err) { return callback(err); } for (var i=0; i