nodebb-plugin-facebook-post 1.0.1 → 1.0.3
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 +3 -3
- package/package.json +5 -2
- package/plugin.json +0 -1
package/library.js
CHANGED
|
@@ -278,8 +278,8 @@ async function enqueueJob(job) {
|
|
|
278
278
|
|
|
279
279
|
async function ensureAdmin(req) {
|
|
280
280
|
const User = require.main.require('./src/user');
|
|
281
|
-
const uid = req.uid;
|
|
282
|
-
if (
|
|
281
|
+
const uid = req.uid || (req.user && (req.user.uid || req.user.uid === 0 ? req.user.uid : null)) || (req.session && req.session.uid);
|
|
282
|
+
if (uid === undefined || uid === null) return false;
|
|
283
283
|
|
|
284
284
|
try { if (await User.isAdministrator(uid)) return true; } catch {}
|
|
285
285
|
try { if (await User.isAdminOrGlobalMod(uid)) return true; } catch {}
|
|
@@ -405,7 +405,7 @@ Plugin.init = async function (params) {
|
|
|
405
405
|
} catch {}
|
|
406
406
|
};
|
|
407
407
|
|
|
408
|
-
Plugin.addAdminNavigation = async function (header) {
|
|
408
|
+
Plugin.addAdminNavigation = async function (header) {
|
|
409
409
|
header.plugins = header.plugins || [];
|
|
410
410
|
header.plugins.push({ route: '/plugins/facebook-post', icon: 'fa-facebook', name: 'Facebook/Instagram Post' });
|
|
411
411
|
return header;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nodebb-plugin-facebook-post",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Queue-based worker to auto-post new NodeBB topics to a fixed Facebook Page and optionally Instagram (images only).",
|
|
5
5
|
"main": "library.js",
|
|
6
6
|
"dependencies": {
|
|
@@ -11,5 +11,8 @@
|
|
|
11
11
|
"engines": {
|
|
12
12
|
"node": ">=18"
|
|
13
13
|
},
|
|
14
|
-
"license": "MIT"
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"nbbpm": {
|
|
16
|
+
"compatibility": "^4.0.0"
|
|
17
|
+
}
|
|
15
18
|
}
|
package/plugin.json
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
"name": "Facebook/Instagram Post (Worker)",
|
|
4
4
|
"description": "Enqueue new NodeBB topics to a worker that posts to a fixed Facebook Page (+ optional Instagram).",
|
|
5
5
|
"url": "https://example.invalid/nodebb-plugin-facebook-post",
|
|
6
|
-
"library": "./library.js",
|
|
7
6
|
"hooks": [
|
|
8
7
|
{
|
|
9
8
|
"hook": "static:app.load",
|