nodebb-plugin-mentions 4.3.0 → 4.3.2
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 +13 -4
- package/package.json +2 -2
- package/templates/admin/plugins/mentions.tpl +2 -2
package/library.js
CHANGED
|
@@ -166,13 +166,22 @@ Mentions.notifyMessage = async (hookData) => {
|
|
|
166
166
|
getUidsToNotify(matches),
|
|
167
167
|
Messaging.getRoomData(roomId),
|
|
168
168
|
]);
|
|
169
|
-
if (!roomData || !matchedUids.length) {
|
|
169
|
+
if (!roomData || !matchedUids.length || !roomData.public) {
|
|
170
170
|
return;
|
|
171
171
|
}
|
|
172
|
-
const
|
|
173
|
-
|
|
172
|
+
const io = require.main.require('./src/socket.io');
|
|
173
|
+
|
|
174
|
+
const [onlineUidsInRoom, isUserInRoom, checks] = await Promise.all([
|
|
175
|
+
io.getUidsInRoom(`chat_room_${roomId}`),
|
|
176
|
+
Messaging.isUsersInRoom(matchedUids, roomId),
|
|
177
|
+
Promise.all(matchedUids.map(
|
|
178
|
+
uid => !roomData.groups.length || Groups.isMemberOfAny(uid, roomData.groups)
|
|
179
|
+
)),
|
|
180
|
+
]);
|
|
181
|
+
|
|
182
|
+
const uidsToNotify = matchedUids.filter(
|
|
183
|
+
(uid, idx) => checks[idx] && isUserInRoom[idx] && !onlineUidsInRoom.includes(String(uid))
|
|
174
184
|
);
|
|
175
|
-
const uidsToNotify = matchedUids.filter((uid, idx) => checks[idx]);
|
|
176
185
|
if (!uidsToNotify.length) {
|
|
177
186
|
return;
|
|
178
187
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nodebb-plugin-mentions",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.2",
|
|
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": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"mocha": "10.2.0",
|
|
35
|
-
"eslint": "8.
|
|
35
|
+
"eslint": "8.45.0",
|
|
36
36
|
"eslint-config-nodebb": "0.2.1",
|
|
37
37
|
"eslint-plugin-import": "2.27.5"
|
|
38
38
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<div class="row m-0">
|
|
5
5
|
<div id="spy-container" class="col-12 col-md-8 px-0 mb-4" tabindex="0">
|
|
6
6
|
<form role="form" class="mentions-settings">
|
|
7
|
-
<div class="mb-4">
|
|
7
|
+
<div id="general" class="mb-4">
|
|
8
8
|
<h5 class="fw-bold tracking-tight settings-header">General</h5>
|
|
9
9
|
|
|
10
10
|
<div class="mb-3 form-check">
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
|
|
39
39
|
</div>
|
|
40
40
|
|
|
41
|
-
<div class="mb-4">
|
|
41
|
+
<div id="restrictions" class="mb-4">
|
|
42
42
|
<h5 class="fw-bold tracking-tight settings-header">Restrictions</h5>
|
|
43
43
|
|
|
44
44
|
<div class="mb-3">
|