nodebb-plugin-facebook-post 1.0.24 → 1.0.25
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/library.js +1 -1
- package/package.json +1 -1
- package/static/lib/composer.js +3 -3
package/library.js
CHANGED
|
@@ -392,7 +392,7 @@ Plugin.onPostSave = async function (hookData) {
|
|
|
392
392
|
|
|
393
393
|
const process = shouldProcessPost(ctx);
|
|
394
394
|
if (!process) {
|
|
395
|
-
const isFirstPost = (ctx.post.isMainPost === true) || (ctx.post.index === 0);
|
|
395
|
+
const isFirstPost = (ctx.post.isMainPost === true) || (ctx.post.index === 0) || (String(ctx.post.pid) === String(ctx.topic.mainPid));
|
|
396
396
|
const fbEnabled = bool(ctx.post.fbPostEnabled);
|
|
397
397
|
const repOk = (ctx.user.reputation || 0) >= settings.minimumReputation;
|
|
398
398
|
const whitelist = parseCsvInts(settings.categoriesWhitelist);
|
package/package.json
CHANGED
package/static/lib/composer.js
CHANGED
|
@@ -115,12 +115,12 @@
|
|
|
115
115
|
$(window).off('filter:composer.submit.fbpost')
|
|
116
116
|
.on('filter:composer.submit.fbpost', function (ev2, submitData) {
|
|
117
117
|
const enabled = $enabled.is(':checked');
|
|
118
|
-
submitData.
|
|
119
|
-
submitData.
|
|
118
|
+
submitData.postData = submitData.postData || {};
|
|
119
|
+
submitData.postData.fbPostEnabled = enabled;
|
|
120
120
|
|
|
121
121
|
if (enabled) {
|
|
122
122
|
const placeId = $composer.find('[data-fbpost-place-id]').val();
|
|
123
|
-
if (placeId) submitData.
|
|
123
|
+
if (placeId) submitData.postData.fbPlaceId = placeId;
|
|
124
124
|
}
|
|
125
125
|
return submitData;
|
|
126
126
|
});
|