filter messages by also looking at media descriptions (#2285)
This commit is contained in:
parent
a221a7b916
commit
c0c8eec36b
2 changed files with 40 additions and 3 deletions
|
|
@ -29,9 +29,16 @@ class FilterModel @Inject constructor() {
|
|||
}
|
||||
|
||||
val spoilerText = status.actionableStatus.spoilerText
|
||||
val attachmentsDescriptions = status.attachments
|
||||
.mapNotNull { it.description }
|
||||
|
||||
return (
|
||||
matcher.reset(status.actionableStatus.content).find() ||
|
||||
spoilerText.isNotEmpty() && matcher.reset(spoilerText).find()
|
||||
(spoilerText.isNotEmpty() && matcher.reset(spoilerText).find()) ||
|
||||
(
|
||||
attachmentsDescriptions.isNotEmpty() &&
|
||||
matcher.reset(attachmentsDescriptions.joinToString("\n")).find()
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue