add displayname to parent posts

This commit is contained in:
Barış Soner Uşaklı
2023-07-12 10:40:25 -04:00
parent e8b40b5884
commit f2152953cd
2 changed files with 8 additions and 8 deletions

View File

@@ -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) {