Skip to content

Commit bf73bf9

Browse files
committed
hashtags: remove un-needed hashtag content filter
We don't really need this, we only care about spam in tags Signed-off-by: William Casarin <[email protected]>
1 parent 3ff91ad commit bf73bf9

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

damus/Features/Timeline/Models/ContentFilters.swift

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -67,27 +67,6 @@ func hashtag_spam_filter(ev: NostrEvent, max_hashtags: Int) -> Bool {
6767
}
6868
}
6969

70-
// Check content text for hashtags
71-
let content = ev.content
72-
var content_count = 0
73-
var i = content.startIndex
74-
75-
while i < content.endIndex {
76-
if content[i] == "#" {
77-
let nextIndex = content.index(after: i)
78-
if nextIndex < content.endIndex {
79-
let nextChar = content[nextIndex]
80-
// Check if next char is a valid hashtag start (letter, number, emoji, non-ASCII)
81-
if nextChar.isLetter || nextChar.isNumber || !nextChar.isASCII {
82-
content_count += 1
83-
if content_count > max_hashtags {
84-
return false
85-
}
86-
}
87-
}
88-
}
89-
i = content.index(after: i)
90-
}
9170
return true
9271
}
9372

0 commit comments

Comments
 (0)