nodebb-plugin-onekite-discord 1.0.4 → 1.0.6

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
@@ -166,18 +166,18 @@ async function buildEmbed({ tid, pid, isReply }) {
166
166
  const targetUrl = (isReply && pid) ? `${topicUrl}/${pid}` : topicUrl;
167
167
 
168
168
  const baseTitle = decodeHtmlEntities((topicData.title || (isReply ? 'Nouvelle réponse' : 'Nouveau sujet')).toString());
169
- const isReply = post && post.pid && post.pid !== topic.mainPid;
170
- const replyIcon = isReply ? '↪️ ' : '';
171
- const title = categoryName ? `[${categoryName}] ${baseTitle}` : baseTitle;
172
- const safeTitle = title.slice(0, 256);
169
+ const titleWithCategory = categoryName ? `[${categoryName}] ${baseTitle}` : baseTitle;
170
+ const replyIcon = isReply ? '↪️ ' : '';
171
+
172
+ const safeTitle = titleWithCategory.slice(0, 256);
173
173
 
174
174
  const excerpt = await getPostExcerpt(isReply ? pid : topicData.mainPid);
175
175
 
176
176
  const postForUser = await posts.getPostFields(isReply ? pid : topicData.mainPid, ['uid']);
177
177
  const username = await user.getUserField(postForUser.uid, 'username');
178
178
 
179
- // Tout le titre dans l'embed : "[Catégorie] Titre - Pseudo" (pseudo sans lien)
180
- const embedTitle = `${safeTitle} - ${username}`.slice(0, 256);
179
+ // Tout le titre dans l'embed : "↪️ [Catégorie] Titre Pseudo" (pseudo sans lien)
180
+ const embedTitle = `${replyIcon}${safeTitle} ${username}`.slice(0, 256);
181
181
 
182
182
  // Embed title becomes clickable via embed.url
183
183
  return { topicData, content: '', embed: { title: embedTitle, url: targetUrl, description: excerpt || '' } };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-onekite-discord",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Discord webhook notifier for Onekite (NodeBB v4.x only)",
5
5
  "main": "library.js",
6
6
  "license": "MIT",
package/plugin.json CHANGED
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "id": "nodebb-plugin-onekite-discord",
3
3
  "name": "Discord Onekite Notifier",
4
- "description": "Notifie Discord via webhook pour nouveaux sujets et/ou r\u00e9ponses (NodeBB v4.x).",
5
- "library": "./library.js",
4
+ "description": "Notifie Discord via webhook pour nouveaux sujets et/ou réponses (NodeBB v4.x).",
6
5
  "hooks": [
7
6
  {
8
7
  "hook": "static:app.load",
@@ -32,5 +31,5 @@
32
31
  "acpScripts": [
33
32
  "public/admin.js"
34
33
  ],
35
- "version": "1.0.4"
36
- }
34
+ "version": "1.0.6"
35
+ }