mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-06 11:27:01 +02:00
Merge branch 'master' into develop
This commit is contained in:
@@ -9,7 +9,6 @@ var plugins = require('../plugins');
|
||||
var utils = require('../../public/src/utils');
|
||||
|
||||
module.exports = function (User) {
|
||||
|
||||
var iconBackgrounds = ['#f44336', '#e91e63', '#9c27b0', '#673ab7', '#3f51b5', '#2196f3',
|
||||
'#009688', '#1b5e20', '#33691e', '#827717', '#e65100', '#ff5722', '#795548', '#607d8b'];
|
||||
|
||||
@@ -143,7 +142,8 @@ module.exports = function (User) {
|
||||
}
|
||||
|
||||
if (user.picture && user.picture === user.uploadedpicture) {
|
||||
user.picture = user.uploadedpicture = user.picture.startsWith('http') ? user.picture : nconf.get('relative_path') + user.picture;
|
||||
user.uploadedpicture = user.picture.startsWith('http') ? user.picture : nconf.get('relative_path') + user.picture;
|
||||
user.picture = user.uploadedpicture;
|
||||
} else if (user.uploadedpicture) {
|
||||
user.uploadedpicture = user.uploadedpicture.startsWith('http') ? user.uploadedpicture : nconf.get('relative_path') + user.uploadedpicture;
|
||||
}
|
||||
@@ -152,7 +152,7 @@ module.exports = function (User) {
|
||||
user.status = User.getStatus(user);
|
||||
}
|
||||
|
||||
for(var i = 0; i < fieldsToRemove.length; ++i) {
|
||||
for (var i = 0; i < fieldsToRemove.length; i += 1) {
|
||||
user[fieldsToRemove[i]] = undefined;
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ module.exports = function (User) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
plugins.fireHook('action:user.set', {uid: uid, field: field, value: value, type: 'set'});
|
||||
plugins.fireHook('action:user.set', { uid: uid, field: field, value: value, type: 'set' });
|
||||
callback();
|
||||
});
|
||||
};
|
||||
@@ -195,7 +195,7 @@ module.exports = function (User) {
|
||||
}
|
||||
for (var field in data) {
|
||||
if (data.hasOwnProperty(field)) {
|
||||
plugins.fireHook('action:user.set', {uid: uid, field: field, value: data[field], type: 'set'});
|
||||
plugins.fireHook('action:user.set', { uid: uid, field: field, value: data[field], type: 'set' });
|
||||
}
|
||||
}
|
||||
callback();
|
||||
@@ -208,7 +208,7 @@ module.exports = function (User) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
plugins.fireHook('action:user.set', {uid: uid, field: field, value: value, type: 'increment'});
|
||||
plugins.fireHook('action:user.set', { uid: uid, field: field, value: value, type: 'increment' });
|
||||
|
||||
callback(null, value);
|
||||
});
|
||||
@@ -220,10 +220,9 @@ module.exports = function (User) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
plugins.fireHook('action:user.set', {uid: uid, field: field, value: value, type: 'decrement'});
|
||||
plugins.fireHook('action:user.set', { uid: uid, field: field, value: value, type: 'decrement' });
|
||||
|
||||
callback(null, value);
|
||||
});
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user