|
|
@ -25,6 +25,7 @@ module.exports = function(User) {
|
|
|
|
settings = data.settings;
|
|
|
|
settings = data.settings;
|
|
|
|
|
|
|
|
|
|
|
|
settings.showemail = settings.showemail ? parseInt(settings.showemail, 10) !== 0 : false;
|
|
|
|
settings.showemail = settings.showemail ? parseInt(settings.showemail, 10) !== 0 : false;
|
|
|
|
|
|
|
|
settings.enableDailyDigest = settings.enableDailyDigest || 'daily';
|
|
|
|
settings.usePagination = settings.usePagination ? parseInt(settings.usePagination, 10) === 1 : parseInt(meta.config.usePagination, 10) === 1;
|
|
|
|
settings.usePagination = settings.usePagination ? parseInt(settings.usePagination, 10) === 1 : parseInt(meta.config.usePagination, 10) === 1;
|
|
|
|
settings.topicsPerPage = settings.topicsPerPage ? parseInt(settings.topicsPerPage, 10) : parseInt(meta.config.topicsPerPage, 10) || 20;
|
|
|
|
settings.topicsPerPage = settings.topicsPerPage ? parseInt(settings.topicsPerPage, 10) : parseInt(meta.config.topicsPerPage, 10) || 20;
|
|
|
|
settings.postsPerPage = settings.postsPerPage ? parseInt(settings.postsPerPage, 10) : parseInt(meta.config.postsPerPage, 10) || 10;
|
|
|
|
settings.postsPerPage = settings.postsPerPage ? parseInt(settings.postsPerPage, 10) : parseInt(meta.config.postsPerPage, 10) || 10;
|
|
|
@ -41,10 +42,12 @@ module.exports = function(User) {
|
|
|
|
return callback(new Error('[[error:invalid-pagination-value]]'));
|
|
|
|
return callback(new Error('[[error:invalid-pagination-value]]'));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
plugins.fireHook('action:user.saveSettings', {uid: uid, settings: data});
|
|
|
|
data.language = data.language || meta.config.defaultLang;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
plugins.fireHook('action:user.saveSettings', {uid: uid, settings: data});
|
|
|
|
db.setObject('user:' + uid + ':settings', {
|
|
|
|
db.setObject('user:' + uid + ':settings', {
|
|
|
|
showemail: data.showemail,
|
|
|
|
showemail: data.showemail,
|
|
|
|
|
|
|
|
enableDailyDigest: data.enableDailyDigest || 'daily',
|
|
|
|
usePagination: data.usePagination,
|
|
|
|
usePagination: data.usePagination,
|
|
|
|
topicsPerPage: data.topicsPerPage,
|
|
|
|
topicsPerPage: data.topicsPerPage,
|
|
|
|
postsPerPage: data.postsPerPage,
|
|
|
|
postsPerPage: data.postsPerPage,
|
|
|
|