mirror of
https://github.com/AllanWang/Frost-for-Facebook.git
synced 2024-11-10 04:52:38 +01:00
Filter notif titles as well from settings, resolves #1333
This commit is contained in:
parent
5831c6bd1b
commit
5b470546fd
@ -126,9 +126,19 @@ enum class NotificationType(
|
||||
L.v { "$name notification data not found" }
|
||||
return -1
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the text doesn't contain any blacklisted keywords
|
||||
*/
|
||||
fun validText(text: String?): Boolean {
|
||||
val t = text ?: return true
|
||||
return Prefs.notificationKeywords.none {
|
||||
t.contains(it, true)
|
||||
}
|
||||
}
|
||||
|
||||
val notifContents = response.data.getUnreadNotifications(data).filter { notif ->
|
||||
val text = notif.text
|
||||
Prefs.notificationKeywords.none { text.contains(it, true) }
|
||||
validText(notif.title) && validText(notif.text)
|
||||
}
|
||||
if (notifContents.isEmpty()) return 0
|
||||
val userId = data.id
|
||||
|
Loading…
Reference in New Issue
Block a user