@nodebb/nodebb-plugin-reactions 2.2.1 → 2.2.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.
- package/languages/pl/reactions.json +25 -0
- package/library.js +8 -6
- package/package.json +1 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"reactions": "Reakcje",
|
|
3
|
+
"add-reaction": "Zareaguj",
|
|
4
|
+
"error.invalid-reaction": "Wadliwa reakcja",
|
|
5
|
+
"error.maximum-reached": "Osiągnięto limit reakcji",
|
|
6
|
+
"error.maximum-per-user-per-post-reached": "Osiągnięto limit reakcji przypadających na jeden wpis",
|
|
7
|
+
"settings.title": "Ustawienia wtyczki",
|
|
8
|
+
"settings.enable-post-reactions": "Włącz reakcje na wpisy",
|
|
9
|
+
"settings.max-reactions-per-post": "Do ilu reakcji na wpis (0 to brak limitu, domyślnie: 4)",
|
|
10
|
+
"settings.max-reactions-per-user-per-post": "Do ilu reakcji na wpis ma przypaść na jednego użytkownika (0 to brak limitu)",
|
|
11
|
+
"settings.max-reactions-per-user-per-post-help": "Limit odnosi się tylko do nowych reakcji a nie do dołączania się do już dodanych.",
|
|
12
|
+
"settings.enable-message-reactions": "Włącz reakcje na wiadomości",
|
|
13
|
+
"settings.max-reactions-per-message": "Do ilu reakcji na wiadomość (0 to brak limitu, domyślnie: 4)",
|
|
14
|
+
"settings.max-reactions-per-user-per-message": "Do ilu reakcji ograniczyć użytkownika reagującego na wiadomość (0 to brak limitu)",
|
|
15
|
+
"settings.max-reactions-per-user-per-message-help": "Limit odnosi się tylko do nowych reakcji a nie do dołączania się do już dodanych.",
|
|
16
|
+
"settings.reaction-reputations": "Reakcja a reputacja reakcji (opcjonalnie)",
|
|
17
|
+
"settings.reaction-reputations-help": "Reputacja powiązana z reakcjami. Wtedy autor wpisu zbiera reputację o ile pojawią się na niego reakcje.",
|
|
18
|
+
"settings.reaction-reputations.add": "Dodaj zasadę",
|
|
19
|
+
"settings.reaction-reputations.reaction": "Reakcja",
|
|
20
|
+
"settings.reaction-reputations.reputation": "Reputacja",
|
|
21
|
+
"settings.reaction-reputations.remove": "Skasuj",
|
|
22
|
+
"settings.reaction-reputations.edit": "Zmień",
|
|
23
|
+
"notification.user-has-reacted-with-to-your-post-in-topic": "<strong>%1</strong> zareagował %2 na wpis w <strong>%3</strong>",
|
|
24
|
+
"notification.user-has-reacted-with-to-your-message-in-room": "<strong>%1</strong> zareagował %2 na wiadomość w <strong class=\"text-nowrap\"><i class=\"fa %3\"></i>%4</strong>"
|
|
25
|
+
}
|
package/library.js
CHANGED
|
@@ -31,8 +31,8 @@ function parse(name) {
|
|
|
31
31
|
if (!emojiAliases) {
|
|
32
32
|
emojiAliases = require.main.require('nodebb-plugin-emoji/build/emoji/aliases.json');
|
|
33
33
|
}
|
|
34
|
-
|
|
35
|
-
return emojiParser.buildEmoji(
|
|
34
|
+
const emoji = nameToEmoji(name) || emojiTable[emojiAliases[name]];
|
|
35
|
+
return emoji ? emojiParser.buildEmoji(emoji, '') : '';
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
const ReactionsPlugin = module.exports;
|
|
@@ -128,12 +128,13 @@ ReactionsPlugin.getPostReactions = async function (data) {
|
|
|
128
128
|
for (const reaction of reactions) {
|
|
129
129
|
const reactionSet = `pid:${post.pid}:reaction:${reaction}`;
|
|
130
130
|
const uids = reactionSetToUsersMap.get(reactionSet);
|
|
131
|
-
|
|
131
|
+
const reactionImage = parse(reaction);
|
|
132
|
+
if (Array.isArray(uids) && reactionImage) {
|
|
132
133
|
post.reactions.push({
|
|
133
134
|
pid: post.pid,
|
|
134
135
|
reacted: uids.includes(String(data.uid)),
|
|
135
136
|
reaction,
|
|
136
|
-
reactionImage:
|
|
137
|
+
reactionImage: reactionImage,
|
|
137
138
|
reactionCount: uids.length,
|
|
138
139
|
});
|
|
139
140
|
}
|
|
@@ -189,12 +190,13 @@ ReactionsPlugin.getMessageReactions = async function (data) {
|
|
|
189
190
|
for (const reaction of reactions) {
|
|
190
191
|
const reactionSet = `mid:${msg.mid}:reaction:${reaction}`;
|
|
191
192
|
const uids = reactionSetToUsersMap.get(reactionSet);
|
|
192
|
-
|
|
193
|
+
const reactionImage = parse(reaction);
|
|
194
|
+
if (Array.isArray(uids) && reactionImage) {
|
|
193
195
|
msg.reactions.push({
|
|
194
196
|
mid: msg.mid,
|
|
195
197
|
reacted: uids.includes(String(data.uid)),
|
|
196
198
|
reaction,
|
|
197
|
-
reactionImage:
|
|
199
|
+
reactionImage: reactionImage,
|
|
198
200
|
reactionCount: uids.length,
|
|
199
201
|
});
|
|
200
202
|
}
|