mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 04:25:55 +01:00
makes recent unread and category pages a lot faster, added logging when a user changes their username
This commit is contained in:
@@ -982,7 +982,7 @@ var async = require('async'),
|
||||
return callback(err, null);
|
||||
}
|
||||
|
||||
posts.getPostFields(pid, ['pid', 'content', 'uid', 'timestamp'], function(err, postData) {
|
||||
posts.getPostFields(pid, ['pid', 'uid', 'timestamp'], function(err, postData) {
|
||||
if (err) {
|
||||
return callback(err, null);
|
||||
} else if(!postData) {
|
||||
@@ -994,26 +994,13 @@ var async = require('async'),
|
||||
return callback(err, null);
|
||||
}
|
||||
|
||||
var stripped = postData.content,
|
||||
timestamp = postData.timestamp,
|
||||
returnObj = {
|
||||
"pid": postData.pid,
|
||||
"username": userData.username || 'anonymous',
|
||||
"userslug": userData.userslug,
|
||||
"picture": userData.picture || gravatar.url('', {}, https = nconf.get('https')),
|
||||
"timestamp": timestamp
|
||||
};
|
||||
|
||||
if (postData.content) {
|
||||
stripped = postData.content.replace(/>.+\n\n/, '');
|
||||
postTools.parse(stripped, function(err, stripped) {
|
||||
returnObj.text = S(stripped).stripTags().s;
|
||||
callback(null, returnObj);
|
||||
});
|
||||
} else {
|
||||
returnObj.text = '';
|
||||
callback(null, returnObj);
|
||||
}
|
||||
callback(null, {
|
||||
pid: postData.pid,
|
||||
username: userData.username || 'anonymous',
|
||||
userslug: userData.userslug,
|
||||
picture: userData.picture || gravatar.url('', {}, https = nconf.get('https')),
|
||||
timestamp: postData.timestamp
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user