From e7c26e02bb326f08c071e9f37ebf80952a0cca97 Mon Sep 17 00:00:00 2001 From: Koni Marti Date: Thu, 1 Feb 2024 23:52:55 +0100 Subject: filter: allow workers to combine filter terms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allow the backend workers to combine the filter terms. Currently, the consecutive filters are joined in the message store with a space (" "). This works well for most backends, but makes the filter combination for notmuch confusing. Example: Issuing two consecutive filter commands in notmuch :filter not tag:list :filter tag:list would create the following filter query 'not tag:list tag:list' This is not what users would expect; they expect: '(not tag:list) and (tag:list)' Note that the notmuch backend works correctly for the given query, but produced a query that does not match the user's expectation. This patch fixes this. The combination of filter terms in other backends remains the same. Reported-by: Ángel Castañeda Signed-off-by: Koni Marti Tested-by: Inwit Acked-by: Robin Jarry --- commands/account/search.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'commands') diff --git a/commands/account/search.go b/commands/account/search.go index 0246a9eb..cd449dfa 100644 --- a/commands/account/search.go +++ b/commands/account/search.go @@ -154,7 +154,7 @@ func (s SearchFilter) Execute(args []string) error { EndDate: s.EndDate, SearchBody: s.Body, SearchAll: s.All, - Terms: s.Terms, + Terms: []string{s.Terms}, } if args[0] == "filter" { -- cgit