|
|
@ -150,8 +150,7 @@ var utils = require('./../public/src/utils.js'),
|
|
|
|
|
|
|
|
|
|
|
|
User.getMultipleUserFields = function(uids, fields, callback) {
|
|
|
|
User.getMultipleUserFields = function(uids, fields, callback) {
|
|
|
|
if(uids.length === 0) {
|
|
|
|
if(uids.length === 0) {
|
|
|
|
callback([]);
|
|
|
|
return callback(null, []);
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var returnData = [];
|
|
|
|
var returnData = [];
|
|
|
@ -160,22 +159,17 @@ var utils = require('./../public/src/utils.js'),
|
|
|
|
return self.indexOf(value) === index;
|
|
|
|
return self.indexOf(value) === index;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
function iterator(uid, callback) {
|
|
|
|
function iterator(uid, next) {
|
|
|
|
User.getUserFields(uid, fields, function(err, userData) {
|
|
|
|
User.getUserFields(uid, fields, function(err, userData) {
|
|
|
|
if(err)
|
|
|
|
if(err)
|
|
|
|
return callback(err);
|
|
|
|
return next(err);
|
|
|
|
returnData.push(userData);
|
|
|
|
returnData.push(userData);
|
|
|
|
callback(null);
|
|
|
|
next(null);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
async.eachSeries(uuids, iterator, function(err) {
|
|
|
|
async.eachSeries(uuids, iterator, function(err) {
|
|
|
|
if(!err) {
|
|
|
|
callback(err, returnData);
|
|
|
|
callback(returnData);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
console.log(err);
|
|
|
|
|
|
|
|
callback(null);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -600,7 +594,7 @@ var utils = require('./../public/src/utils.js'),
|
|
|
|
topics.getTopicField(tid, 'slug', function(err, slug) {
|
|
|
|
topics.getTopicField(tid, 'slug', function(err, slug) {
|
|
|
|
var message = '<strong>' + username + '</strong> made a new post';
|
|
|
|
var message = '<strong>' + username + '</strong> made a new post';
|
|
|
|
|
|
|
|
|
|
|
|
notifications.create(message, 5, nconf.get('url') + 'topic/' + slug + '#' + pid, 'notification_'+ Date.now(), function(nid) {
|
|
|
|
notifications.create(message, 5, nconf.get('relative_path') + '/topic/' + slug + '#' + pid, 'notification_'+ Date.now(), function(nid) {
|
|
|
|
notifications.push(nid, followers);
|
|
|
|
notifications.push(nid, followers);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|