nodebb-plugin-composer-default 10.2.45 → 10.2.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/static/lib/composer.js +6 -3
- package/websockets.js +2 -2
package/package.json
CHANGED
package/static/lib/composer.js
CHANGED
|
@@ -430,11 +430,14 @@ define('composer', [
|
|
|
430
430
|
};
|
|
431
431
|
|
|
432
432
|
async function getSelectedCategory(postData) {
|
|
433
|
-
|
|
433
|
+
const { template } = ajaxify.data;
|
|
434
|
+
const cid = parseInt(postData.cid, 10);
|
|
435
|
+
if ((template.category || template.world) && cid === parseInt(ajaxify.data.cid, 10)) {
|
|
434
436
|
// no need to load data if we are already on the category page
|
|
435
437
|
return ajaxify.data;
|
|
436
|
-
} else if (
|
|
437
|
-
|
|
438
|
+
} else if (cid) {
|
|
439
|
+
const categoryUrl = cid !== -1 ? `/api/category/${postData.cid}` : `/api/world`;
|
|
440
|
+
return await api.get(categoryUrl, {});
|
|
438
441
|
}
|
|
439
442
|
return null;
|
|
440
443
|
}
|
package/websockets.js
CHANGED
|
@@ -14,7 +14,7 @@ Sockets.push = async function (socket, pid) {
|
|
|
14
14
|
throw new Error('[[error:no-privileges]]');
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
const postData = await posts.getPostFields(pid, ['content', 'tid', 'uid', 'handle', 'timestamp']);
|
|
17
|
+
const postData = await posts.getPostFields(pid, ['content', 'sourceContent', 'tid', 'uid', 'handle', 'timestamp']);
|
|
18
18
|
if (!postData && !postData.content) {
|
|
19
19
|
throw new Error('[[error:invalid-pid]]');
|
|
20
20
|
}
|
|
@@ -33,7 +33,7 @@ Sockets.push = async function (socket, pid) {
|
|
|
33
33
|
pid: pid,
|
|
34
34
|
uid: postData.uid,
|
|
35
35
|
handle: parseInt(meta.config.allowGuestHandles, 10) ? postData.handle : undefined,
|
|
36
|
-
body: postData.content,
|
|
36
|
+
body: postData.sourceContent || postData.content,
|
|
37
37
|
title: topic.title,
|
|
38
38
|
thumb: topic.thumb,
|
|
39
39
|
tags: tags,
|