nodebb-plugin-mentions 4.3.2 → 4.3.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.
Files changed (2) hide show
  1. package/library.js +6 -2
  2. package/package.json +1 -1
package/library.js CHANGED
@@ -171,16 +171,20 @@ Mentions.notifyMessage = async (hookData) => {
171
171
  }
172
172
  const io = require.main.require('./src/socket.io');
173
173
 
174
- const [onlineUidsInRoom, isUserInRoom, checks] = await Promise.all([
174
+ const [onlineUidsInRoom, isUserInRoom, notifSettings, checks] = await Promise.all([
175
175
  io.getUidsInRoom(`chat_room_${roomId}`),
176
176
  Messaging.isUsersInRoom(matchedUids, roomId),
177
+ Messaging.getUidsNotificationSetting(matchedUids, roomId),
177
178
  Promise.all(matchedUids.map(
178
179
  uid => !roomData.groups.length || Groups.isMemberOfAny(uid, roomData.groups)
179
180
  )),
180
181
  ]);
181
182
 
182
183
  const uidsToNotify = matchedUids.filter(
183
- (uid, idx) => checks[idx] && isUserInRoom[idx] && !onlineUidsInRoom.includes(String(uid))
184
+ (uid, idx) => checks[idx] &&
185
+ isUserInRoom[idx] &&
186
+ !onlineUidsInRoom.includes(String(uid)) &&
187
+ notifSettings[idx] === Messaging.notificationSettings.ATMENTION
184
188
  );
185
189
  if (!uidsToNotify.length) {
186
190
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-mentions",
3
- "version": "4.3.2",
3
+ "version": "4.3.3",
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
  "scripts": {