mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-21 07:50:37 +01:00
add displayname to parent posts
This commit is contained in:
@@ -327,11 +327,11 @@ module.exports = function (utils, Benchpress, relative_path) {
|
||||
}
|
||||
|
||||
function generateRepliedTo(post, timeagoCutoff) {
|
||||
const username = post.parent && post.parent.username ?
|
||||
post.parent.username : '[[global:guest]]';
|
||||
const displayname = post.parent && post.parent.displayname ?
|
||||
post.parent.displayname : '[[global:guest]]';
|
||||
const isBeforeCutoff = post.timestamp < (Date.now() - (timeagoCutoff * oneDayInMs));
|
||||
const langSuffix = isBeforeCutoff ? 'on' : 'ago';
|
||||
return `[[topic:replied-to-user-${langSuffix}, ${post.toPid}, ${relative_path}/post/${post.toPid}, ${username}, ${relative_path}/post/${post.pid}, ${post.timestampISO}]]`;
|
||||
return `[[topic:replied-to-user-${langSuffix}, ${post.toPid}, ${relative_path}/post/${post.toPid}, ${displayname}, ${relative_path}/post/${post.pid}, ${post.timestampISO}]]`;
|
||||
}
|
||||
|
||||
function generateWrote(post, timeagoCutoff) {
|
||||
|
||||
Reference in New Issue
Block a user