@nodebb/nodebb-plugin-reactions 2.2.7 → 2.2.8

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/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # nodebb-plugin-reactions
2
2
  Reactions plugin for NodeBB
3
3
 
4
+ This plugin requires nodebb-plugin-emoji to be active.
5
+
4
6
  # Installation
5
7
  Install via one-click activation in the Admin Control Panel or run the following command:
6
8
 
@@ -12,4 +14,4 @@ Install via one-click activation in the Admin Control Panel or run the following
12
14
  ![demo](./assets/demo.png)
13
15
 
14
16
  ## ACP:
15
- ![acp](./assets/acp.png)
17
+ ![acp](./assets/acp.png)
@@ -0,0 +1,3 @@
1
+ {
2
+ "notificationType-reaction": "When someone reacts to your posts & chats"
3
+ }
package/library.js CHANGED
@@ -81,6 +81,16 @@ ReactionsPlugin.filterSettingsGet = async function (hookData) {
81
81
  return hookData;
82
82
  };
83
83
 
84
+ ReactionsPlugin.addNotificationFilters = async (data) => {
85
+ data.regularFilters.push({ name: '[[reactions:reactions]]', filter: 'reaction' });
86
+ return data;
87
+ };
88
+
89
+ ReactionsPlugin.notificationTypes = async (data) => {
90
+ data.types.push('notificationType_reaction');
91
+ return data;
92
+ };
93
+
84
94
  ReactionsPlugin.getPostReactions = async function (data) {
85
95
  if (data.uid === 0) {
86
96
  return data;
@@ -370,6 +380,7 @@ SocketPlugins.reactions = {
370
380
  topics.getTopicFields(data.tid, ['title']),
371
381
  ]);
372
382
  const notifObj = await notifications.create({
383
+ type: 'reaction',
373
384
  bodyShort: translator.compile(
374
385
  'reactions:notification.user-has-reacted-with-to-your-post-in-topic',
375
386
  userData.displayname,
@@ -484,6 +495,7 @@ SocketPlugins.reactions = {
484
495
  const icon = messaging.getRoomIcon(roomData);
485
496
 
486
497
  const notifObj = await notifications.create({
498
+ type: 'reaction',
487
499
  bodyShort: translator.compile(
488
500
  'reactions:notification.user-has-reacted-with-to-your-message-in-room',
489
501
  userData.displayname,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nodebb/nodebb-plugin-reactions",
3
- "version": "2.2.7",
3
+ "version": "2.2.8",
4
4
  "nbbpm": {
5
5
  "compatibility": "^3.6.0 || ^4.0.0"
6
6
  },
package/plugin.json CHANGED
@@ -16,29 +16,15 @@
16
16
  "../admin/plugins/reactions.js": "./public/admin.js"
17
17
  },
18
18
  "hooks": [
19
- {
20
- "hook": "static:app.load", "method": "init"
21
- },
22
- {
23
- "hook": "filter:admin.header.build", "method": "addAdminNavigation"
24
- },
25
- {
26
- "hook": "filter:config.get", "method": "getPluginConfig"
27
- },
28
- {
29
- "hook": "filter:settings.get", "method": "filterSettingsGet"
30
- },
31
- {
32
- "hook": "filter:post.getPosts", "method": "getPostReactions"
33
- },
34
- {
35
- "hook": "filter:messaging.getMessages", "method": "getMessageReactions"
36
- },
37
- {
38
- "hook": "filter:post.get", "method": "onReply"
39
- },
40
- {
41
- "hook": "action:posts.purge", "method": "deleteReactions"
42
- }
19
+ { "hook": "static:app.load", "method": "init" },
20
+ { "hook": "filter:admin.header.build", "method": "addAdminNavigation"},
21
+ { "hook": "filter:config.get", "method": "getPluginConfig" },
22
+ { "hook": "filter:settings.get", "method": "filterSettingsGet" },
23
+ { "hook": "filter:post.getPosts", "method": "getPostReactions" },
24
+ { "hook": "filter:messaging.getMessages", "method": "getMessageReactions" },
25
+ { "hook": "filter:post.get", "method": "onReply" },
26
+ { "hook": "action:posts.purge", "method": "deleteReactions" },
27
+ { "hook": "filter:notifications.addFilters", "method": "addNotificationFilters" },
28
+ { "hook": "filter:user.notificationTypes", "method": "notificationTypes" }
43
29
  ]
44
30
  }