Node.js based forum software built for the modern web
chore: stop loading user signatures in topic lists (#14640)
palmoni5766fb6aa80e2
diff --git a/public/openapi/components/schemas/TopicObject.yaml b/public/openapi/components/schemas/TopicObject.yamlindex 68ae3c1236..2d1aa9dcf6 100644--- a/public/openapi/components/schemas/TopicObject.yaml+++ b/public/openapi/components/schemas/TopicObject.yaml@@ -57,9 +57,6 @@ TopicObject:picture:type: stringnullable: true- signature:- type: string- nullable: truestatus:type: stringicon:text:@@ -87,7 +84,6 @@ TopicObject:- reputation- postcount- picture- - signature- banned- status- icon:textdiff --git a/public/openapi/read/tags/tag.yaml b/public/openapi/read/tags/tag.yamlindex 6756e16e2b..8ce04974ca 100644--- a/public/openapi/read/tags/tag.yaml+++ b/public/openapi/read/tags/tag.yaml@@ -127,9 +127,6 @@ get:picture:nullable: truetype: string- signature:- nullable: true- type: stringbanned:type: numberstatus:diff --git a/public/openapi/read/unread.yaml b/public/openapi/read/unread.yamlindex 763449bade..fc04442d67 100644--- a/public/openapi/read/unread.yaml+++ b/public/openapi/read/unread.yaml@@ -91,9 +91,6 @@ get:picture:nullable: truetype: string- signature:- nullable: true- type: stringbanned:type: booleanstatus:@@ -121,7 +118,6 @@ get:- reputation- postcount- picture- - signature- banned- status- icon:textdiff --git a/src/topics/index.js b/src/topics/index.jsindex 4b7ccfb052..50a507a527 100644--- a/src/topics/index.js+++ b/src/topics/index.js@@ -101,7 +101,7 @@ Topics.getTopicsByTids = async function (tids, options) {const [teasers, users, userSettings, categoriesData, guestHandles, thumbs] = await Promise.all([Topics.getTeasers(topics, options),- user.getUsersFields(uids, ['uid', 'username', 'fullname', 'userslug', 'reputation', 'postcount', 'picture', 'signature', 'banned', 'status']),+ user.getUsersFields(uids, ['uid', 'username', 'fullname', 'userslug', 'reputation', 'postcount', 'picture', 'banned', 'status']),loadShowfullnameSettings(),categories.getCategoriesFields(cids, ['cid', 'name', 'slug', 'icon', 'backgroundImage', 'imageClass', 'bgColor', 'color', 'disabled']),loadGuestHandles(),diff --git a/test/topics.js b/test/topics.jsindex 57f850d0d5..10c27cbb8e 100644--- a/test/topics.js+++ b/test/topics.js@@ -2370,6 +2370,19 @@ describe('Topic\'s', () => {assert.strictEqual(data.topics[0].title, 'old replied');assert.strictEqual(data.topics[1].title, 'most recent replied');});++ it('should not expose the author signature', async () => {+ await User.setUserField(topic.userId, 'signature', 'some signature');+ const data = await topics.getSortedTopics({+ cids: [category.cid],+ uid: topic.userId,+ start: 0,+ stop: -1,+ sort: 'recent',+ });+ assert(data.topics[0].user);+ assert.strictEqual(data.topics[0].user.signature, undefined);+ });});describe('scheduled topics', () => {