Skip to content
Snippets Groups Projects
Commit 017f4016 authored by echicken's avatar echicken
Browse files

Check oneliners read from the DB contain all necessary data before passing them along.

parent e3f11ee5
No related branches found
No related tags found
No related merge requests found
......@@ -30,13 +30,29 @@ var Oneliners = function(server, port, callback) {
this.__defineSetter__('count', function() {});
this.read = function(start, end) {
return jsonClient.slice(
var ret = [];
var lines = jsonClient.slice(
"ONELINERS",
"ONELINERS",
start,
(typeof end == "undefined") ? undefined : end,
1
);
while(lines.length > 0) {
var line = lines.shift();
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"
) {
continue;
}
ret.push(line);
}
return ret;
}
this.post = function(alias, oneliner) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment