nodebb-plugin-onekite-discord 1.0.2 → 1.0.4

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,7 +166,9 @@ 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 title = categoryName ? `[${categoryName}] ${baseTitle}` : baseTitle;
169
+ const isReply = post && post.pid && post.pid !== topic.mainPid;
170
+ const replyIcon = isReply ? '↪️ ' : '';
171
+ const title = categoryName ? `[${categoryName}] ${baseTitle}` : baseTitle;
170
172
  const safeTitle = title.slice(0, 256);
171
173
 
172
174
  const excerpt = await getPostExcerpt(isReply ? pid : topicData.mainPid);
@@ -174,10 +176,11 @@ async function buildEmbed({ tid, pid, isReply }) {
174
176
  const postForUser = await posts.getPostFields(isReply ? pid : topicData.mainPid, ['uid']);
175
177
  const username = await user.getUserField(postForUser.uid, 'username');
176
178
 
177
- // "Titre actuel avec lien" - Pseudo (pseudo sans lien)
178
- const content = `[${safeTitle}](${targetUrl}) - ${username}`;
179
+ // Tout le titre dans l'embed : "[Catégorie] Titre - Pseudo" (pseudo sans lien)
180
+ const embedTitle = `${safeTitle} - ${username}`.slice(0, 256);
179
181
 
180
- return { topicData, content, embed: { description: excerpt || '' } };
182
+ // Embed title becomes clickable via embed.url
183
+ return { topicData, content: '', embed: { title: embedTitle, url: targetUrl, description: excerpt || '' } };
181
184
  }
182
185
 
183
186
  function extractTidPid(data) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-onekite-discord",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
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
@@ -32,5 +32,5 @@
32
32
  "acpScripts": [
33
33
  "public/admin.js"
34
34
  ],
35
- "version": "1.0.2"
35
+ "version": "1.0.4"
36
36
  }