nodebb-plugin-discord-onekite 1.1.15 → 1.1.17

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/README.md CHANGED
@@ -1,8 +1,9 @@
1
- # nodebb-plugin-discord-onekite v1.1.4.7
1
+ # nodebb-plugin-discord-onekite v1.1.4.9
2
2
 
3
- Discord output cleanup:
4
- - Removes the extra content line under the title.
5
- - Sends an embed where:
6
- - title is clickable (embed.url)
7
- - embed description contains the message excerpt
8
- - `content` is only used as a fallback if Discord rejects embeds.
3
+ ACP uses official NodeBB approach (quickstart):
4
+ - `settings.sync()` + `settings.persist()`
5
+ - save button partial (bottom-right)
6
+
7
+ Discord embed:
8
+ - clickable title (embed.url)
9
+ - description = message excerpt only
package/library.js CHANGED
@@ -129,7 +129,8 @@ async function getPostExcerpt(pid) {
129
129
  }
130
130
 
131
131
  async function buildPayload({ tid, pid, isReply }) {
132
- const baseUrl = normalizeBaseUrl(meta.config.url);
132
+ let baseUrl = normalizeBaseUrl(meta.config.url || meta.config['url']);
133
+ if (!baseUrl) { baseUrl = 'https://www.onekite.com'; }
133
134
 
134
135
  const topicData = await topics.getTopicFields(tid, ['tid', 'uid', 'cid', 'title', 'slug', 'mainPid']);
135
136
  if (!topicData) return null;
@@ -183,16 +184,6 @@ Plugin.init = async ({ router }) => {
183
184
  );
184
185
 
185
186
  // AJAX save endpoint for ACP (used by admin.js)
186
- router.post('/api/admin/plugins/discord-onekite/save',
187
- middleware.admin.checkPrivileges,
188
- async (req, res) => {
189
- try {
190
- const payload = {
191
- webhookUrl: req.body.webhookUrl || '',
192
- notifyReplies: req.body.notifyReplies ? 'on' : '',
193
- cids: req.body.cids || '',
194
- };
195
- await meta.settings.set(SETTINGS_KEY, payload);
196
187
  res.json({ ok: true });
197
188
  } catch (e) {
198
189
  console.error('[discord-onekite] save failed', e);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-discord-onekite",
3
- "version": "1.1.15",
3
+ "version": "1.1.17",
4
4
  "description": "Discord webhook notifier for Onekite (NodeBB v4.x only)",
5
5
  "main": "library.js",
6
6
  "license": "MIT",
@@ -27,6 +27,6 @@
27
27
  </p>
28
28
  </div>
29
29
 
30
- <button id="save" type="button" class="btn btn-primary">Enregistrer les paramètres</button>
30
+ <!-- IMPORT admin/partials/save_button.tpl -->
31
31
  </form>
32
32
  </div>