Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't seem to filter using SearchCondition for a specific combo #153

Open
Shogan opened this issue Jan 27, 2014 · 2 comments
Open

Can't seem to filter using SearchCondition for a specific combo #153

Shogan opened this issue Jan 27, 2014 · 2 comments

Comments

@Shogan
Copy link

Shogan commented Jan 27, 2014

Try as I may, I can't seem to filter out this criteria:

Messages should be:

  • Unseen
  • To a specific address
    Not contain "offer", "offered", "wanted" or "taken" in the subject line.

I've tried various combos, this is my latest attempt, which didn't work either:

var catchAll = ic.SearchMessages(SearchCondition.Unseen()
.Not(SearchCondition.Subject("offer")
.Not(SearchCondition.Subject("offered")
.Not(SearchCondition.Subject("wanted")
.Not(SearchCondition.Subject("taken"))))).And(SearchCondition.To(mainAddress)));

My other filters which are also fairly complex (but don't use "Not") all work perfectly though. Am I doing my SearchCondition above wrong?

@Shogan
Copy link
Author

Shogan commented Apr 7, 2014

Feel free to close this, I couldn't get a long list of nested conditions working nicely, so I ended up just creating my own matching methods with regex after doing an initial filter for SearchCondition.Unseen and SearchCondition.To. I then simply iterate the results of the above two search conditions and do my own nested checking on the subject / bodies of remaining messages in the result array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@Shogan and others