mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-03 19:11:22 +01:00
fix: don't publish name on generated titles
This commit is contained in:
@@ -598,19 +598,19 @@ Mocks.notes.public = async (post) => {
|
|||||||
let tag = null;
|
let tag = null;
|
||||||
let followersUrl;
|
let followersUrl;
|
||||||
|
|
||||||
let name;
|
let { titleRaw: name, generatedTitle } = await topics.getTopicFields(post.tid, ['title', 'generatedTitle']);
|
||||||
({ titleRaw: name } = await topics.getTopicFields(post.tid, ['title']));
|
if (generatedTitle) {
|
||||||
|
name = null;
|
||||||
|
}
|
||||||
|
|
||||||
if (post.toPid) { // direct reply
|
if (post.toPid) { // direct reply
|
||||||
inReplyTo = utils.isNumber(post.toPid) ? `${nconf.get('url')}/post/${post.toPid}` : post.toPid;
|
inReplyTo = utils.isNumber(post.toPid) ? `${nconf.get('url')}/post/${post.toPid}` : post.toPid;
|
||||||
name = `Re: ${name}`;
|
|
||||||
|
|
||||||
const parentId = await posts.getPostField(post.toPid, 'uid');
|
const parentId = await posts.getPostField(post.toPid, 'uid');
|
||||||
followersUrl = await user.getUserField(parentId, 'followersUrl');
|
followersUrl = await user.getUserField(parentId, 'followersUrl');
|
||||||
to.add(utils.isNumber(parentId) ? `${nconf.get('url')}/uid/${parentId}` : parentId);
|
to.add(utils.isNumber(parentId) ? `${nconf.get('url')}/uid/${parentId}` : parentId);
|
||||||
} else if (!post.isMainPost) { // reply to OP
|
} else if (!post.isMainPost) { // reply to OP
|
||||||
inReplyTo = utils.isNumber(post.topic.mainPid) ? `${nconf.get('url')}/post/${post.topic.mainPid}` : post.topic.mainPid;
|
inReplyTo = utils.isNumber(post.topic.mainPid) ? `${nconf.get('url')}/post/${post.topic.mainPid}` : post.topic.mainPid;
|
||||||
name = `Re: ${name}`;
|
|
||||||
|
|
||||||
to.add(utils.isNumber(post.topic.uid) ? `${nconf.get('url')}/uid/${post.topic.uid}` : post.topic.uid);
|
to.add(utils.isNumber(post.topic.uid) ? `${nconf.get('url')}/uid/${post.topic.uid}` : post.topic.uid);
|
||||||
followersUrl = await user.getUserField(post.topic.uid, 'followersUrl');
|
followersUrl = await user.getUserField(post.topic.uid, 'followersUrl');
|
||||||
@@ -798,15 +798,15 @@ Mocks.notes.public = async (post) => {
|
|||||||
type: isArticle ? 'Article' : 'Note',
|
type: isArticle ? 'Article' : 'Note',
|
||||||
to: Array.from(to),
|
to: Array.from(to),
|
||||||
cc: Array.from(cc),
|
cc: Array.from(cc),
|
||||||
inReplyTo,
|
...(inReplyTo && { inReplyTo }),
|
||||||
|
...(name && { name }),
|
||||||
published,
|
published,
|
||||||
updated,
|
...(updated && { updated }),
|
||||||
url: id,
|
url: id,
|
||||||
attributedTo: `${nconf.get('url')}/uid/${post.user.uid}`,
|
attributedTo: `${nconf.get('url')}/uid/${post.user.uid}`,
|
||||||
context,
|
context,
|
||||||
audience,
|
audience,
|
||||||
summary,
|
...(summary && { summary }),
|
||||||
name,
|
|
||||||
preview,
|
preview,
|
||||||
content: post.content,
|
content: post.content,
|
||||||
source,
|
source,
|
||||||
|
|||||||
Reference in New Issue
Block a user