@nodebb/nodebb-plugin-reactions 2.2.8 → 2.2.9
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/languages/en-GB/reactions.json +1 -1
- package/library.js +8 -4
- package/package.json +1 -1
|
@@ -21,5 +21,5 @@
|
|
|
21
21
|
"settings.reaction-reputations.remove": "Delete",
|
|
22
22
|
"settings.reaction-reputations.edit": "Edit",
|
|
23
23
|
"notification.user-has-reacted-with-to-your-post-in-topic": "<strong>%1</strong> has reacted with %2 to your post in <strong>%3</strong>",
|
|
24
|
-
"notification.user-has-reacted-with-to-your-message-in-room": "<strong>%1</strong> has reacted with %2 to your message in <strong class=\"text-nowrap\"><i class=\"fa %3\"></i
|
|
24
|
+
"notification.user-has-reacted-with-to-your-message-in-room": "<strong>%1</strong> has reacted with %2 to your message in <strong class=\"text-nowrap\"><i class=\"fa %3\"></i> %4</strong>"
|
|
25
25
|
}
|
package/library.js
CHANGED
|
@@ -336,7 +336,7 @@ SocketPlugins.reactions = {
|
|
|
336
336
|
}
|
|
337
337
|
const maximumReactions = settings.maximumReactions || DEFAULT_MAX_EMOTES;
|
|
338
338
|
const [postData, totalReactions, emojiIsAlreadyExist, alreadyReacted, reactionReputation] = await Promise.all([
|
|
339
|
-
posts.getPostFields(data.pid, ['tid', 'uid']),
|
|
339
|
+
posts.getPostFields(data.pid, ['pid', 'tid', 'uid', 'content', 'sourceContent']),
|
|
340
340
|
db.setCount(`pid:${data.pid}:reactions`),
|
|
341
341
|
db.isSetMember(`pid:${data.pid}:reactions`, data.reaction),
|
|
342
342
|
db.isSetMember(`pid:${data.pid}:reaction:${data.reaction}`, socket.uid),
|
|
@@ -375,9 +375,10 @@ SocketPlugins.reactions = {
|
|
|
375
375
|
}
|
|
376
376
|
|
|
377
377
|
if (postData.uid && postData.uid !== socket.uid) {
|
|
378
|
-
const [userData, topicData] = await Promise.all([
|
|
378
|
+
const [userData, topicData, parsedPostData] = await Promise.all([
|
|
379
379
|
user.getUserFields(socket.uid, ['username', 'fullname']),
|
|
380
380
|
topics.getTopicFields(data.tid, ['title']),
|
|
381
|
+
posts.parsePost(postData),
|
|
381
382
|
]);
|
|
382
383
|
const notifObj = await notifications.create({
|
|
383
384
|
type: 'reaction',
|
|
@@ -387,6 +388,7 @@ SocketPlugins.reactions = {
|
|
|
387
388
|
`:${data.reaction}:`,
|
|
388
389
|
topicData.title
|
|
389
390
|
),
|
|
391
|
+
bodyLong: parsedPostData.content,
|
|
390
392
|
nid: `uid:${socket.uid}:pid:${data.pid}:reaction:${data.reaction}`,
|
|
391
393
|
pid: data.pid,
|
|
392
394
|
tid: data.tid,
|
|
@@ -452,7 +454,7 @@ SocketPlugins.reactions = {
|
|
|
452
454
|
}
|
|
453
455
|
const maximumReactionsPerMessage = settings.maximumReactionsPerMessage || DEFAULT_MAX_EMOTES;
|
|
454
456
|
const [msgData, totalReactions, emojiIsAlreadyExist] = await Promise.all([
|
|
455
|
-
messaging.getMessageFields(data.mid, ['roomId', 'fromuid']),
|
|
457
|
+
messaging.getMessageFields(data.mid, ['roomId', 'fromuid', 'content']),
|
|
456
458
|
db.setCount(`mid:${data.mid}:reactions`),
|
|
457
459
|
db.isSetMember(`mid:${data.mid}:reactions`, data.reaction),
|
|
458
460
|
]);
|
|
@@ -487,9 +489,10 @@ SocketPlugins.reactions = {
|
|
|
487
489
|
]);
|
|
488
490
|
|
|
489
491
|
if (msgData.fromuid && msgData.fromuid !== socket.uid) {
|
|
490
|
-
const [userData, roomData] = await Promise.all([
|
|
492
|
+
const [userData, roomData, parsedMessage] = await Promise.all([
|
|
491
493
|
user.getUserFields(socket.uid, ['username', 'userslug', 'fullname']),
|
|
492
494
|
messaging.getRoomData(roomId),
|
|
495
|
+
messaging.parse(msgData.content, socket.uid, msgData.fromuid, roomId, false),
|
|
493
496
|
]);
|
|
494
497
|
const roomName = roomData.roomName || `[[modules:chat.room-id, ${roomId}]]`;
|
|
495
498
|
const icon = messaging.getRoomIcon(roomData);
|
|
@@ -503,6 +506,7 @@ SocketPlugins.reactions = {
|
|
|
503
506
|
icon,
|
|
504
507
|
roomName
|
|
505
508
|
),
|
|
509
|
+
bodyLong: parsedMessage,
|
|
506
510
|
roomIcon: icon,
|
|
507
511
|
nid: `uid:${socket.uid}:mid:${data.mid}:reaction:${data.reaction}`,
|
|
508
512
|
mid: data.mid,
|