updating profile fields to allow plugins (e.g. the write-api) to change a user's profile picture

@barisusakli please let me know if this is not ok.
This commit is contained in:
Julian Lam
2016-07-11 18:26:04 -04:00
parent 1f5913c874
commit c8e64ae93b
2 changed files with 2 additions and 1 deletions

View File

@@ -90,6 +90,7 @@ var fallbackTransport;
}, },
function (results, next) { function (results, next) {
var data = { var data = {
_raw: params,
to: email, to: email,
from: meta.config['email:from'] || 'no-reply@' + getHostname(), from: meta.config['email:from'] || 'no-reply@' + getHostname(),
from_name: meta.config['email:from_name'] || 'NodeBB', from_name: meta.config['email:from_name'] || 'NodeBB',

View File

@@ -13,7 +13,7 @@ var plugins = require('../plugins');
module.exports = function(User) { module.exports = function(User) {
User.updateProfile = function(uid, data, callback) { User.updateProfile = function(uid, data, callback) {
var fields = ['username', 'email', 'fullname', 'website', 'location', 'groupTitle', 'birthday', 'signature', 'aboutme']; var fields = ['username', 'email', 'fullname', 'website', 'location', 'groupTitle', 'birthday', 'signature', 'aboutme', 'picture', 'uploadedpicture'];
plugins.fireHook('filter:user.updateProfile', {uid: uid, data: data, fields: fields}, function(err, data) { plugins.fireHook('filter:user.updateProfile', {uid: uid, data: data, fields: fields}, function(err, data) {
if (err) { if (err) {