Comment on [Bug] Boolean lines in contact allowlists with more than one OR don't work
jupiter_rowland@hub.netzgemeinde.eu@hub.netzgemeinde.eu 1 week ago
As of Hubzilla 11.4.1, the behaviour seems to have changed.
If you have a chain of criteria with OR (
If you have
Likewise, if you have
Test cases:
The second and the fifth test case should fail, the others should pass.
If you have a chain of criteria with OR (
||) between them on the allowlist, only the first and last criteria will pass.If you have
?body ~= foo || ?body ~= bar || ?body ~= baz as an allowlist line:- Messages with "foo" will pass
- Messages with "bar" will not pass
- Messages with "baz" will pass"
Likewise, if you have
?body ~= foo || ?body ~= bar || ?body ~= baz || ?body ~= qux || ~body ~= quux as an allowlist line:- Messages with "foo" will pass
- Messages with "bar" will not pass
- Messages with "baz" will not pass
- Messages with "qux" will not pass
- Messages with "quux" will pass"
Test cases:
'incl: three criteria with OR, all keywords expected in the body, first one present in the body' => [
'?body ~= grasshopper || ?body ~= rosencrantz || ?body ~= guildenstern',
'',
true
],
'incl: three criteria with OR, all keywords expected in the body, second one present in the body' => [
'?body ~= rosencrantz || ?body ~= grasshopper || ?body ~= guildenstern',
'',
true
],
'incl: three criteria with OR, all keywords expected in the body, last one present in the body' => [
'?body ~= rosencrantz || ?body ~= guildenstern || ?body ~= grasshopper',
'',
true
],
'incl: three criteria with OR, all keywords expected in the body, first one present in the body; excl: item must not be a repeat' => [
'?body ~= grasshopper || ?body ~= rosencrantz || ?body ~= guildenstern',
'?verb == Announce',
true
],
'incl: three criteria with OR, all keywords expected in the body, second one present in the body; excl: item must not be a repeat' => [
'?body ~= rosencrantz || ?body ~= grasshopper || ?body ~= guildenstern',
'?verb == Announce',
true
],
'incl: three criteria with OR, all keywords expected in the body, last one present in the body; excl: item must not be a repeat' => [
'?body ~= rosencrantz || ?body ~= guildenstern || ?body ~= grasshopper',
'?verb == Announce',
true
],The second and the fifth test case should fail, the others should pass.
https://framagit.org/hubzilla/core/-/commit/57acdc4bdf35d2178337205844f14edb8e2319a5