* New @systemMethod

This commit is contained in:
Bryan Ashby 2015-04-20 23:24:15 -06:00
parent ec5f1836c5
commit 5ab89f952f
7 changed files with 99 additions and 41 deletions

View file

@ -209,25 +209,12 @@ function prepareClient(client, cb) {
if('*' === conf.config.preLoginTheme) {
var theme = require('./theme.js');
async.waterfall(
[
function getRandTheme(callback) {
theme.getRandomTheme(function randTheme(err, themeId) {
client.user.properties.theme_id = themeId || '';
callback(null);
});
},
function setCurrentThemeInfo(callback) {
theme.getThemeInfo(client.user.properties.theme_id, function themeInfo(err, info) {
client.currentThemeInfo = info;
callback(null);
});
}
],
function complete(err) {
cb(err);
}
);
client.user.properties.theme_id = theme.getRandomTheme() || '';
theme.getThemeInfo(client.user.properties.theme_id, function themeInfo(err, info) {
client.currentThemeInfo = info;
cb(null);
});
} else {
client.user.properties.theme_id = conf.config.preLoginTheme;
cb(null);