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 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-facebook-post",
3
- "version": "1.0.24",
3
+ "version": "1.0.25",
4
4
  "description": "Auto-post new NodeBB topics to a fixed Facebook Page (text + NodeBB uploads + place id).",
5
5
  "main": "library.js",
6
6
  "dependencies": {
@@ -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.data = submitData.data || {};
119
- submitData.data.fbPostEnabled = enabled;
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.data.fbPlaceId = placeId;
123
+ if (placeId) submitData.postData.fbPlaceId = placeId;
124
124
  }
125
125
  return submitData;
126
126
  });