mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-10 06:34:41 +02:00
* New @systemMethod
This commit is contained in:
parent
ec5f1836c5
commit
5ab89f952f
7 changed files with 99 additions and 41 deletions
25
core/bbs.js
25
core/bbs.js
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue