Merge pull request #2426 from Schamper/image-upload-socket-fix

Fix the hook return object in the User.uploadProfileImageFromUrl socket
v1.18.x
Julian Lam 10 years ago
commit e0fba796c7

@ -199,13 +199,13 @@ SocketUser.uploadProfileImageFromUrl = function(socket, url, callback) {
return;
}
plugins.fireHook('filter:uploadImage', {image: {url: url}, uid: socket.uid}, function(err, image) {
plugins.fireHook('filter:uploadImage', {image: {url: url}, uid: socket.uid}, function(err, data) {
if (err) {
return callback(err);
}
user.setUserFields(socket.uid, {uploadedpicture: image.url, picture: image.url}, function(err) {
callback(err, image.url);
user.setUserFields(socket.uid, {uploadedpicture: data.image.url, picture: data.image.url}, function(err) {
callback(err, data.image.url);
});
});
};

Loading…
Cancel
Save