applesauce-core 0.0.0-next-20250424151127 → 0.0.0-next-20250424153457
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/dist/helpers/mutes.js +4 -4
- package/package.json +1 -1
package/dist/helpers/mutes.js
CHANGED
|
@@ -56,12 +56,12 @@ export function createMutedWordsRegExp(mutedWords) {
|
|
|
56
56
|
/** Returns true if the event matches the mutes */
|
|
57
57
|
export function matchMutes(mutes, event) {
|
|
58
58
|
// Filter on muted pubkeys
|
|
59
|
-
if (mutes.pubkeys) {
|
|
59
|
+
if (mutes.pubkeys.size > 0) {
|
|
60
60
|
if (mutes.pubkeys.has(event.pubkey))
|
|
61
61
|
return true;
|
|
62
62
|
}
|
|
63
63
|
// Filter on muted hashtags`
|
|
64
|
-
if (mutes.hashtags) {
|
|
64
|
+
if (mutes.hashtags.size > 0) {
|
|
65
65
|
const tags = getIndexableTags(event);
|
|
66
66
|
for (let tag of mutes.hashtags) {
|
|
67
67
|
if (tags.has("t:" + tag))
|
|
@@ -69,13 +69,13 @@ export function matchMutes(mutes, event) {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
// Filter on muted threads
|
|
72
|
-
if (mutes.threads && event.kind === kinds.ShortTextNote) {
|
|
72
|
+
if (mutes.threads.size > 0 && event.kind === kinds.ShortTextNote) {
|
|
73
73
|
const refs = getNip10References(event);
|
|
74
74
|
if (refs.root?.e && mutes.threads.has(refs.root.e.id))
|
|
75
75
|
return true;
|
|
76
76
|
}
|
|
77
77
|
// Filter on muted words
|
|
78
|
-
if (mutes.words) {
|
|
78
|
+
if (mutes.words.size > 0) {
|
|
79
79
|
const regExp = createMutedWordsRegExp(Array.from(mutes.words));
|
|
80
80
|
if (regExp.test(event.content))
|
|
81
81
|
return true;
|