[Feature request] Filters with switchable operators that allow keywords and filter syntax simultaneously
[Feature request] Filters with switchable operators that allow keywords and filter syntax simultaneously
New issue on Framagit:Currently, Hubzilla's handling of filter lists seems to be this way:
- Loose keywords are always connected by
OR
. - Filter syntax lines are always connected by
AND
, at least in the whitelists. - Both are mutually fully exclusive. If the last line is a keyword, only keywords are parsed using
OR
, and filter syntax lines are ignored. If the last line is filter syntax, only filter syntax lines will be parsed with AND
, and keyword lines are ignored.
An improvement for Hubzilla's filters that looks fairly easy to me would be to introduce a switch for each filter list that can switch the whole list between OR
and AND
, regardless of what's on the list, loose keywords or filter syntax. With such a switch in place, Hubzilla could safely parse both loose keywords and filter syntax on the same filter list instead of only what comes last.
To keep compatibility with existing filter list, the position of the switch upon its introduction could depend on the content of the filter list: If it's all syntax, or maybe if the list ends with syntax, the switch is set to AND
, otherwise it's set to OR
.
#
Filters