nodebb-plugin-mentions 4.6.8 → 4.6.10

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
@@ -131,7 +131,7 @@ Mentions.notify = async function ({ post }) {
131
131
  return;
132
132
  }
133
133
 
134
- const [topic, userData, topicFollowers] = await Promise.all([
134
+ let [topic, userData, topicFollowers] = await Promise.all([
135
135
  Topics.getTopicFields(post.tid, ['title', 'cid']),
136
136
  User.getUserFields(post.uid, ['username']),
137
137
  Mentions._settings.disableFollowedTopics === 'on' ? Topics.getFollowers(post.tid) : [],
@@ -139,9 +139,10 @@ Mentions.notify = async function ({ post }) {
139
139
  const { displayname } = userData;
140
140
  const title = entitiesDecode(topic.title);
141
141
  const titleEscaped = title.replace(/%/g, '%').replace(/,/g, ',');
142
+ topicFollowers = topicFollowers.map(uid => parseInt(uid, 10));
142
143
 
143
144
  let uids = uidsToNotify.filter(
144
- uid => parseInt(uid, 10) !== postOwner && !topicFollowers.includes(uid)
145
+ uid => parseInt(uid, 10) !== postOwner && !topicFollowers.includes(parseInt(uid, 10))
145
146
  );
146
147
 
147
148
  if (Mentions._settings.privilegedDirectReplies === 'on') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-mentions",
3
- "version": "4.6.8",
3
+ "version": "4.6.10",
4
4
  "description": "NodeBB Plugin that allows users to mention other users by prepending an '@' sign to their username",
5
5
  "main": "library.js",
6
6
  "repository": {
@@ -29,7 +29,7 @@
29
29
  "devDependencies": {
30
30
  "eslint": "^9.0.0",
31
31
  "eslint-config-nodebb": "0.2.1",
32
- "eslint-plugin-import": "2.29.1",
33
- "mocha": "10.7.3"
32
+ "eslint-plugin-import": "2.31.0",
33
+ "mocha": "10.8.2"
34
34
  }
35
35
  }
@@ -45,8 +45,9 @@
45
45
  <div class="mb-3 form-check">
46
46
  <input type="checkbox" class="form-check-input" id="disableFollowedTopics" name="disableFollowedTopics" />
47
47
  <label for="disableFollowedTopics" class="form-check-label">
48
- <span>Disable mentions for followed topics</span>
48
+ <span>Do not notify mentioned users in topics topics they already follow</span>
49
49
  </label>
50
+ <p class="form-text">This avoids the &quot;double notification&quot; for recipients.</p>
50
51
  </div>
51
52
  </div>
52
53
  <div class="mb-3">