addressbook-query: Fix filter matching for empty filters

This commit is contained in:
Lennart
2026-01-04 00:05:07 +01:00
parent 44ae995f29
commit 1567bc64ef
2 changed files with 9 additions and 0 deletions

View File

@@ -82,6 +82,11 @@ pub struct FilterElement {
impl FilterElement { impl FilterElement {
#[must_use] #[must_use]
pub fn matches(&self, addr_object: &AddressObject) -> bool { pub fn matches(&self, addr_object: &AddressObject) -> bool {
if self.prop_filter.is_empty() {
// Filter empty
return true;
}
let Allof(allof) = self.test; let Allof(allof) = self.test;
let mut results = self let mut results = self
.prop_filter .prop_filter

View File

@@ -32,6 +32,10 @@ pub struct PropFilterElement {
impl PropFilterElement { impl PropFilterElement {
#[must_use] #[must_use]
pub fn match_property(&self, property: &Property) -> bool { pub fn match_property(&self, property: &Property) -> bool {
if self.param_filter.is_empty() && self.text_match.is_empty() {
// Filter empty
return true;
}
let Allof(allof) = self.test; let Allof(allof) = self.test;
let text_matches = self let text_matches = self
.text_match .text_match