This commit is contained in:
barisusakli
2014-09-24 17:13:12 -04:00
parent 016a98e7b1
commit c000e852b5
4 changed files with 54 additions and 9 deletions

View File

@@ -186,6 +186,22 @@ SocketUser.changePicture = function(socket, data, callback) {
});
};
SocketUser.uploadProfileImageFromUrl = function(socket, url, callback) {
if (!socket.uid || !url) {
return;
}
plugins.fireHook('filter:uploadImage', {url: url}, function(err, image) {
if (err) {
return callback(err);
}
user.setUserFields(socket.uid, {uploadedpicture: image.url, picture: image.url}, function(err) {
callback(err, image.url);
});
});
}
SocketUser.follow = function(socket, data, callback) {
if (!socket.uid || !data) {
return;