Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit 61ce0eeb authored by Deucе's avatar Deucе 👌🏾

Allow variables in both left and right sides of a conditional @choice

Fixes CNW "Vehicles & People" people list.
parent 1313bdb5
......@@ -2010,30 +2010,32 @@ function run_ref(sec, fname)
do {
m = l.match(/^([-\+=\!><])([`&0-9a-zA-Z]+) ([^ ]+) /)
if (m !== null) {
var left = getvar(m[2]);
var right = getvar(m[3]);
l = l.substr(m[0].length);
switch(m[1]) {
case '=':
if (getvar(m[2]).toString() !== m[3])
if (left.toString().toLowerCase() !== right.toLowerCase())
return;
break;
case '!':
if (getvar(m[2]).toString() === m[3])
if (left.toString().toLowerCase() === right.toLowerCase())
return;
break;
case '<':
if (getvar(m[2]) >= parseInt(m[3], 10))
if (parseInt(left, 10) >= parseInt(right, 10))
return;
break;
case '>':
if (getvar(m[2]) <= parseInt(m[3], 10))
if (parseInt(left, 10) <= parseInt(right, 10))
return;
break;
case '+':
if (!(getvar(m[2]) & (1 << parseInt(m[3], 10))))
if (!(left & (1 << parseInt(right, 10))))
return;
break;
case '-':
if (getvar(m[2]) & (1 << parseInt(m[3], 10)))
if (left & (1 << parseInt(right, 10)))
return;
break;
default:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment