diff --git a/xtrn/oneliners/framed.js b/xtrn/oneliners/framed.js index 125d78fd25ab3c02062bce8108bbaf8c35b04ed8..55570b7bdb3c3c9f9be06aec9bc60f29b448e409 100644 --- a/xtrn/oneliners/framed.js +++ b/xtrn/oneliners/framed.js @@ -67,6 +67,7 @@ var initFrames = function() { LIGHTGRAY, frame ); + onelinersFrame.v_scroll = true; inputAliasFrame = new Frame( onelinersFrame.x, @@ -141,6 +142,9 @@ var init = function() { } var putOneliner = function(oneliner) { + oneliner.oneliner = strip_exascii(oneliner.oneliner); + if(oneliner.oneliner.length < 1) + return; onelinersFrame.putmsg( format( "\1n\1w%s\1n\1c@\1h\1b%s\1h\1k: \1n\1w%s\r\n", @@ -206,7 +210,9 @@ var main = function() { userInput = userInput.replace(/\\1/g, ascii(1)); if(console.strlen(userInput) < 1) continue; - postOneliner(user.alias, userInput); + var o = postOneliner(user.alias, userInput); + if(o) + putOneliner(o); } continue; } @@ -244,4 +250,4 @@ var cleanUp = function() { init(); main(); -cleanUp(); \ No newline at end of file +cleanUp(); diff --git a/xtrn/oneliners/lib.js b/xtrn/oneliners/lib.js index f66578adf5a82ca9e59db928c5b1f021dfa694ea..6090169e68c07a538091b7d6a4be41676d4d9716 100644 --- a/xtrn/oneliners/lib.js +++ b/xtrn/oneliners/lib.js @@ -10,7 +10,7 @@ var initSettings = function(path) { var postOneliner = function(alias, userInput) { try { - oneliners.post(alias, userInput); + return oneliners.post(alias, userInput); } catch(err) { log(LOG_ERR, "JSON client error: " + err); exit(); @@ -40,13 +40,17 @@ var Oneliners = function(server, port, callback) { ); while(lines.length > 0) { var line = lines.shift(); + if(typeof line == "undefined") // Probably a deleted oneliner + continue; if( typeof line.time != "number" || typeof line.client != "string" || typeof line.alias != "string" || typeof line.systemName != "string" || typeof line.systemHost != "string" || typeof line.qwkid != "string" || line.qwkid.length > 8 || - typeof line.oneliner != "string" + typeof line.oneliner != "string" || + typeof strip_ctrl(line.oneliner) == "undefined" || + strip_ctrl(line.oneliner).length < 1 ) { continue; } @@ -56,6 +60,9 @@ var Oneliners = function(server, port, callback) { } this.post = function(alias, oneliner) { + var o = strip_ctrl(oneliner.oneliner); + if(typeof o == "undefined") + return false; var obj = { 'time' : time(), 'client' : (typeof client != "undefined") ? client.ip_address : system.inet_addr, @@ -71,6 +78,7 @@ var Oneliners = function(server, port, callback) { obj, 2 ); + return obj; } this.cycle = function() {