afterxleep/Bouncer

Filter when two rules match (AND operation)

kms1212 opened this issue · 6 comments

Is your feature request related to a problem? Please describe.

Describe the solution you'd like
I think the app will be more convenient to use if a rule contains multiple filters. (e.g. In Korea, it is likely a spam message if the phone number of the sender of the message starts with "010"(cellular phone identifier) and the contents of the message starts with "[Web 발신]"(prepended when a message is sent by the online text message service).)

Describe alternatives you've considered
I think there's no alternative ways to do this in this application.

Additional context

Hey there.

While not really straightforward, you can add multiple rules by using regular expressions in the following format and the "Match as Regular expression" toggle.

I'll consider adding this as a UI setting in a future release.

OR:
word1|word2|word

AND:
^(?=.*word1)(?=.*word2)(?=.*word3).*

Hmm... What about combining the sender number filter and the message text filter?

This should work:

image

I'm very sorry to interrupt you so much, but I think you're misinterpreting my question. I know how to combine multiple matches in regular expression, but that's not the thing.

Since a rule does not support multiple filtering operation(for example, combining FilterType.any and FilterType.sender in a single rule), it's not possible to this:

Filter when only both conditions are true:
1. The sender is unknown and the phone number matches regex "/^(?:\+82 ?|0)10-?[0-9]{4}-?[0-9]{4}/"
2. The message content starts with (or contains) string "[Web 발신]"

I'll send you a pull requests when I implement this feature later, if you reopen this issue.

By the way, would you mind if I ask you to check the pull request I sent?

I understand, but considering that Bouncer is designed around simplicity, I have no plans to implement this feature for now.

OK, thank you for your reply.