diff --git a/exec/load/presence_lib.js b/exec/load/presence_lib.js index 96508c8de71cf1c7b64d2b0b1128bfdeea3847bb..362384854dd4677a188739df3c118591855fbff9 100755 --- a/exec/load/presence_lib.js +++ b/exec/load/presence_lib.js @@ -138,7 +138,7 @@ function extended_status(num) f.position = num * 128; var str = f.read(128); f.close(); - return str; + return truncsp(str); } // Returns a string describing the node status, suitable for printing on a single line @@ -148,11 +148,13 @@ function extended_status(num) // options values supported/used: // .include_age // .include_gender +// .exclude_username // .username_prefix // .status_prefix // .age_prefix // .gender_prefix // .gender_separator +// .exclude_connection // .connection_prefix // .errors_prefix function node_status(node, is_sysop, options, num) @@ -174,12 +176,14 @@ function node_status(node, is_sysop, options, num) } var user = new User(node.useron); - if(options.username_prefix) - output += options.username_prefix; - if(js.global.bbs && (misc&NODE_ANON) && !is_sysop) - output += bbs.text(UNKNOWN_USER); - else - output += user.alias; + if (!options.exclude_username) { + if(options.username_prefix) + output += options.username_prefix; + if(js.global.bbs && (misc&NODE_ANON) && !is_sysop) + output += bbs.text(UNKNOWN_USER); + else + output += user.alias; + } if(options.status_prefix) output += options.status_prefix; output += user_age_and_gender(user, options); @@ -201,9 +205,11 @@ function node_status(node, is_sysop, options, num) output += format(NodeAction[node.action], node.aux); break; } - if(options.connection_prefix) - output += options.connection_prefix; - output += node_connection_desc(node); + if (!options.exclude_connection) { + if(options.connection_prefix) + output += options.connection_prefix; + output += node_connection_desc(node); + } break; } case NODE_LOGON: diff --git a/webv4/lib/events/nodelist.js b/webv4/lib/events/nodelist.js index 88673c04ef6a1ae6782af47a06ac95ebe65fe46b..aa99e303caecb54f5a6059ac602c449043d7fc97 100644 --- a/webv4/lib/events/nodelist.js +++ b/webv4/lib/events/nodelist.js @@ -1,3 +1,5 @@ +require("presence_lib.js", 'extended_status'); + var last_run = 0; var frequency = 15; @@ -80,10 +82,11 @@ function scan() { }; } else { usr.number = e.useron; + return { node: i + 1, status: format(NodeStatus[e.status], e.aux, e.extaux), - action: format(NodeAction[e.action], e.aux, e.extaux), + action: node_status(e, user.is_sysop, {exclude_username: true, exclude_connection: true}, i), user: (e.misc & NODE_ANON) && !user.is_sysop ? "Anonymous" : usr.alias, connection : NodeConnectionProper[e.connection] ? NodeConnectionProper[e.connection] : (e.connection + ' bps') }; diff --git a/webv4/root/api/system.ssjs b/webv4/root/api/system.ssjs index 0c6fe82ef4dc7c9b5b4eb52237e98777bba19af9..f93ad8d6a519596bbc24096ffe26662886d4b5e5 100644 --- a/webv4/root/api/system.ssjs +++ b/webv4/root/api/system.ssjs @@ -1,5 +1,6 @@ require('sbbsdefs.js', 'SYS_CLOSED'); require('nodedefs.js', 'NODE_WFC'); +require("presence_lib.js", 'extended_status'); var settings = load('modopts.js', 'web') || { web_directory: '../webv4' }; load(settings.web_directory + '/lib/init.js'); @@ -42,7 +43,7 @@ if ((http_request.method === 'GET' || http_request.method === 'POST') && http_re a.push({ node: i, status: format(NodeStatus[c.status], c.aux, c.extaux), - action: format(NodeAction[c.action], c.aux, c.extaux), + action: node_status(c, user.is_sysop, {exclude_username: true, exclude_connection: true}, i), user: usr.alias, connection: usr.connection });