fix reprööted posts not being muted properly. fix muted posts making
desktop notifications
This commit is contained in:
parent
cf3fbdd610
commit
b5c1d074f8
5 changed files with 83 additions and 17 deletions
|
@ -1,3 +1,4 @@
|
|||
import { filter } from 'lodash'
|
||||
import sanitize from 'sanitize-html'
|
||||
|
||||
export const removeAttachmentLinks = (html) => {
|
||||
|
@ -12,4 +13,14 @@ export const parse = (html) => {
|
|||
return removeAttachmentLinks(html)
|
||||
}
|
||||
|
||||
export const muteWordHits = (status, muteWords) => {
|
||||
const statusText = status.text.toLowerCase()
|
||||
const statusSummary = status.summary.toLowerCase()
|
||||
const hits = filter(muteWords, (muteWord) => {
|
||||
return statusText.includes(muteWord.toLowerCase()) || statusSummary.includes(muteWord.toLowerCase())
|
||||
})
|
||||
|
||||
return hits
|
||||
}
|
||||
|
||||
export default parse
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue