From ddbbb55453cd302b560ca3ae79da1254503760be Mon Sep 17 00:00:00 2001 From: Misty Release Bot Date: Thu, 14 Mar 2024 16:11:23 +0000 Subject: [PATCH 01/12] chore: incrementing version number - v3.7.1 --- install/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/package.json b/install/package.json index e352cb4ab9..c940dbc967 100644 --- a/install/package.json +++ b/install/package.json @@ -2,7 +2,7 @@ "name": "nodebb", "license": "GPL-3.0", "description": "NodeBB Forum", - "version": "3.7.0", + "version": "3.7.1", "homepage": "https://www.nodebb.org", "repository": { "type": "git", From 076403897d4f4fad7694136ee40790e45824aec4 Mon Sep 17 00:00:00 2001 From: Misty Release Bot Date: Thu, 14 Mar 2024 16:11:24 +0000 Subject: [PATCH 02/12] chore: update changelog for v3.7.1 --- CHANGELOG.md | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dec30e072d..a66d1f9207 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,61 @@ +#### v3.7.1 (2024-03-14) + +##### Chores + +* up harmony (1b24b337) +* up harmony (b6c3a9d2) +* up harmony (f107a7ff) +* incrementing version number - v3.7.0 (9a6153d7) +* update changelog for v3.7.0 (f1f81b17) +* incrementing version number - v3.6.7 (86a17e38) +* incrementing version number - v3.6.6 (6604bf37) +* incrementing version number - v3.6.5 (6c653625) +* incrementing version number - v3.6.4 (83d131b4) +* incrementing version number - v3.6.3 (fc7d2bfd) +* incrementing version number - v3.6.2 (0f577a57) +* incrementing version number - v3.6.1 (f1a69468) +* incrementing version number - v3.6.0 (4cdf85f8) +* incrementing version number - v3.5.3 (ed0e8783) +* incrementing version number - v3.5.2 (52fbb2da) +* incrementing version number - v3.5.1 (4c543488) +* incrementing version number - v3.5.0 (d06fb4f0) +* incrementing version number - v3.4.3 (5c984250) +* incrementing version number - v3.4.2 (3f0dac38) +* incrementing version number - v3.4.1 (01e69574) +* incrementing version number - v3.4.0 (fd9247c5) +* incrementing version number - v3.3.9 (5805e770) +* incrementing version number - v3.3.8 (a5603565) +* incrementing version number - v3.3.7 (b26f1744) +* incrementing version number - v3.3.6 (7fb38792) +* incrementing version number - v3.3.4 (a67f84ea) +* incrementing version number - v3.3.3 (f94d239b) +* incrementing version number - v3.3.2 (ec9dac97) +* incrementing version number - v3.3.1 (151cc68f) +* incrementing version number - v3.3.0 (fc1ad70f) +* incrementing version number - v3.2.3 (b06d3e63) +* incrementing version number - v3.2.2 (758ecfcd) +* incrementing version number - v3.2.1 (20145074) +* incrementing version number - v3.2.0 (9ecac38e) +* incrementing version number - v3.1.7 (0b4e81ab) +* incrementing version number - v3.1.6 (b3a3b130) +* incrementing version number - v3.1.5 (ec19343a) +* incrementing version number - v3.1.4 (2452783c) +* incrementing version number - v3.1.3 (3b4e9d3f) +* incrementing version number - v3.1.2 (40fa3489) +* incrementing version number - v3.1.1 (40250733) +* incrementing version number - v3.1.0 (0cb386bd) +* incrementing version number - v3.0.1 (26f6ea49) +* incrementing version number - v3.0.0 (224e08cd) + +##### New Features + +* allow setting max-old-space-size in config (d1ce594c) + +##### Bug Fixes + +* #12408, fix mem leak due to mongodb 6.4.0 (285293c4) +* tids:create on topic post (3b48695b) + #### v3.7.0 (2024-03-06) ##### Chores From 4787d013cf4a862a0ecb46f09b6dde655abf5e16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Sat, 16 Mar 2024 18:56:54 -0400 Subject: [PATCH 03/12] fix: #12415, fix notification escaping for queued posts --- src/socket.io/posts.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/socket.io/posts.js b/src/socket.io/posts.js index 9eef769cb3..a684d95783 100644 --- a/src/socket.io/posts.js +++ b/src/socket.io/posts.js @@ -11,6 +11,7 @@ const topics = require('../topics'); const notifications = require('../notifications'); const utils = require('../utils'); const events = require('../events'); +const translator = require('../translator'); const api = require('../api'); const sockets = require('.'); @@ -159,10 +160,13 @@ async function canEditQueue(socket, data, action) { } async function sendQueueNotification(type, targetUid, path, notificationText) { + const bodyShort = notificationText ? + translator.compile(`notifications:${type}`, notificationText) : + translator.compile(`notifications:${type}`); const notifData = { type: type, nid: `${type}-${targetUid}-${path}`, - bodyShort: notificationText ? `[[notifications:${type}, ${notificationText}]]` : `[[notifications:${type}]]`, + bodyShort: bodyShort, path: path, }; if (parseInt(meta.config.postQueueNotificationUid, 10) > 0) { From 5924a6eb43d39eb8c4c103f0f4739bddc24115f5 Mon Sep 17 00:00:00 2001 From: Tomas Nesrovnal Date: Mon, 18 Mar 2024 17:25:07 +0100 Subject: [PATCH 04/12] feat: add playsinline video attribute (#12419) --- src/posts/parse.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/posts/parse.js b/src/posts/parse.js index 75747b3887..f36013dd77 100644 --- a/src/posts/parse.js +++ b/src/posts/parse.js @@ -22,7 +22,7 @@ let sanitizeConfig = { a: ['href', 'name', 'hreflang', 'media', 'rel', 'target', 'type'], img: ['alt', 'height', 'ismap', 'src', 'usemap', 'width', 'srcset'], iframe: ['height', 'name', 'src', 'width'], - video: ['autoplay', 'controls', 'height', 'loop', 'muted', 'poster', 'preload', 'src', 'width'], + video: ['autoplay', 'playsinline', 'controls', 'height', 'loop', 'muted', 'poster', 'preload', 'src', 'width'], audio: ['autoplay', 'controls', 'loop', 'muted', 'preload', 'src'], source: ['type', 'src', 'srcset', 'sizes', 'media', 'height', 'width'], embed: ['height', 'src', 'type', 'width'], From 168419cf2429bf20be39056bb6acf4a7b3c307fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Tue, 26 Mar 2024 09:57:34 -0400 Subject: [PATCH 05/12] feat: add hook to modify sorting options/fields --- src/topics/sorted.js | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/topics/sorted.js b/src/topics/sorted.js index d244eefe61..23f55b63cb 100644 --- a/src/topics/sorted.js +++ b/src/topics/sorted.js @@ -159,18 +159,24 @@ module.exports = function (Topics) { return tids; } - const topicData = await Topics.getTopicsFields(tids, [ - 'tid', 'timestamp', 'lastposttime', 'upvotes', 'downvotes', 'postcount', 'pinned', - ]); - const sortMap = { - recent: sortRecent, - old: sortOld, - create: sortCreate, - posts: sortPopular, - votes: sortVotes, - views: sortViews, - }; - const sortFn = sortMap[params.sort] || sortRecent; + const { sortMap, fields } = await plugins.hooks.fire('filter:topics.sortOptions', { + params, + fields: [ + 'tid', 'timestamp', 'lastposttime', 'upvotes', 'downvotes', 'postcount', 'pinned', + ], + sortMap: { + recent: sortRecent, + old: sortOld, + create: sortCreate, + posts: sortPopular, + votes: sortVotes, + views: sortViews, + }, + }); + console.log(params.sort); + const topicData = await Topics.getTopicsFields(tids, fields); + const sortFn = sortMap.hasOwnProperty(params.sort) && sortMap[params.sort] ? + sortMap[params.sort] : sortRecent; if (params.floatPinned) { floatPinned(topicData, sortFn); From 3b2d8551d7b24a66e37a69b7d0c8bf028da17cb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Tue, 26 Mar 2024 10:08:30 -0400 Subject: [PATCH 06/12] refactor: remove log --- src/topics/sorted.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/topics/sorted.js b/src/topics/sorted.js index 23f55b63cb..92cc2f6ed6 100644 --- a/src/topics/sorted.js +++ b/src/topics/sorted.js @@ -173,7 +173,7 @@ module.exports = function (Topics) { views: sortViews, }, }); - console.log(params.sort); + const topicData = await Topics.getTopicsFields(tids, fields); const sortFn = sortMap.hasOwnProperty(params.sort) && sortMap[params.sort] ? sortMap[params.sort] : sortRecent; From 8b3811a19892bedfaba92b72dd9c647c2af4d709 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 25 Mar 2024 16:04:54 -0400 Subject: [PATCH 07/12] make checkboxes more visible --- src/views/partials/acceptTos.tpl | 7 +++---- src/views/partials/gdpr_consent.tpl | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/views/partials/acceptTos.tpl b/src/views/partials/acceptTos.tpl index f5dafb2423..c9f7ba42fb 100644 --- a/src/views/partials/acceptTos.tpl +++ b/src/views/partials/acceptTos.tpl @@ -1,9 +1,8 @@
{termsOfUse}
-
- +
+ +
\ No newline at end of file diff --git a/src/views/partials/gdpr_consent.tpl b/src/views/partials/gdpr_consent.tpl index 21ec19074c..ea25aeb43c 100644 --- a/src/views/partials/gdpr_consent.tpl +++ b/src/views/partials/gdpr_consent.tpl @@ -2,7 +2,7 @@

[[user:consent.lead]]

[[user:consent.intro]]

- +
@@ -16,7 +16,7 @@

- +
\ No newline at end of file From ba9bcd0166e3ac4aa27c9e645c5516f00361ab0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Tue, 26 Mar 2024 10:22:11 -0400 Subject: [PATCH 08/12] remove border gray --- src/views/partials/acceptTos.tpl | 2 +- src/views/partials/gdpr_consent.tpl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/views/partials/acceptTos.tpl b/src/views/partials/acceptTos.tpl index c9f7ba42fb..d077d692b1 100644 --- a/src/views/partials/acceptTos.tpl +++ b/src/views/partials/acceptTos.tpl @@ -2,7 +2,7 @@
{termsOfUse}
- +
\ No newline at end of file diff --git a/src/views/partials/gdpr_consent.tpl b/src/views/partials/gdpr_consent.tpl index ea25aeb43c..1759d39589 100644 --- a/src/views/partials/gdpr_consent.tpl +++ b/src/views/partials/gdpr_consent.tpl @@ -2,7 +2,7 @@

[[user:consent.lead]]

[[user:consent.intro]]

- +
@@ -16,7 +16,7 @@

- +
\ No newline at end of file From c6915398f911d703e6638fc17f510dcf73c9736e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Tue, 26 Mar 2024 10:24:20 -0400 Subject: [PATCH 09/12] chore: up harmony --- install/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install/package.json b/install/package.json index c940dbc967..48e82063ed 100644 --- a/install/package.json +++ b/install/package.json @@ -103,8 +103,8 @@ "nodebb-plugin-ntfy": "1.7.3", "nodebb-plugin-spam-be-gone": "2.2.1", "nodebb-rewards-essentials": "1.0.0", - "nodebb-theme-harmony": "1.2.40", - "nodebb-theme-lavender": "7.1.7", + "nodebb-theme-harmony": "1.2.43", + "nodebb-theme-lavender": "7.1.8", "nodebb-theme-peace": "2.2.4", "nodebb-theme-persona": "13.3.11", "nodebb-widget-essentials": "7.0.15", From 0171e73a786924a762b5b4afc6714c877fa6484b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Tue, 26 Mar 2024 12:58:34 -0400 Subject: [PATCH 10/12] chore: up harmony --- install/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/package.json b/install/package.json index 48e82063ed..cc9242c550 100644 --- a/install/package.json +++ b/install/package.json @@ -103,7 +103,7 @@ "nodebb-plugin-ntfy": "1.7.3", "nodebb-plugin-spam-be-gone": "2.2.1", "nodebb-rewards-essentials": "1.0.0", - "nodebb-theme-harmony": "1.2.43", + "nodebb-theme-harmony": "1.2.44", "nodebb-theme-lavender": "7.1.8", "nodebb-theme-peace": "2.2.4", "nodebb-theme-persona": "13.3.11", From ed41e416e269fc5317d09888aed0c64f90020206 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Tue, 26 Mar 2024 18:50:25 -0400 Subject: [PATCH 11/12] fix: #12446, fix groups.ownership.rescind --- src/groups/ownership.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/groups/ownership.js b/src/groups/ownership.js index ade58e65c9..c7ae09ae2d 100644 --- a/src/groups/ownership.js +++ b/src/groups/ownership.js @@ -28,8 +28,10 @@ module.exports = function (Groups) { Groups.ownership.rescind = async function (toUid, groupName) { // If the owners set only contains one member (and toUid is that member), error out! - const numOwners = await db.setCount(`group:${groupName}:owners`); - const isOwner = await db.isSortedSetMember(`group:${groupName}:owners`); + const [numOwners, isOwner] = await Promise.all([ + db.setCount(`group:${groupName}:owners`), + db.isSetMember(`group:${groupName}:owners`, toUid), + ]); if (numOwners <= 1 && isOwner) { throw new Error('[[error:group-needs-owner]]'); } From bf4e257c83988f5231721473acdb3c919d651d1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Tue, 26 Mar 2024 18:59:11 -0400 Subject: [PATCH 12/12] test: add test for #12446 --- test/groups.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/groups.js b/test/groups.js index 3fc70f009a..7b5ae4d73c 100644 --- a/test/groups.js +++ b/test/groups.js @@ -914,6 +914,19 @@ describe('Groups', () => { assert(!isInvited); }); + it('should fail to rescind last owner', async () => { + const uid = await User.create({ username: 'lastgroupowner' }); + await Groups.create({ + name: 'last owner', + description: 'Foobar!', + ownerUid: uid, + }); + await assert.rejects( + apiGroups.rescind({ uid: adminUid }, { slug: 'last-owner', uid: uid }), + { message: '[[error:group-needs-owner]]' }, + ); + }); + it('should error if user is not invited', async () => { await assert.rejects( apiGroups.acceptInvite({ uid: adminUid }, { slug: 'privatecanjoin', uid: adminUid }),