diff --git a/chatcommand.js b/chatcommand.js index fd497dfc..65285fea 100644 --- a/chatcommand.js +++ b/chatcommand.js @@ -72,6 +72,12 @@ function handle(chan, user, msg, data) { } else if(msg.indexOf("/d") == 0 && msg.length > 2 && msg[2].match(/[-0-9 ]/)) { + if(msg[2] == "-") { + if(msg.length == 3) + return; + if(!msg[3].match(/[0-9]/)) + return; + } handleDrink(chan, user, msg.substring(2), data); } else if(msg.indexOf("/clear") == 0) { diff --git a/www/assets/js/acp.js b/www/assets/js/acp.js index 6c0a3001..759d6821 100644 --- a/www/assets/js/acp.js +++ b/www/assets/js/acp.js @@ -71,10 +71,11 @@ $("#listloaded_refresh").click(function() { menuHandler("#show_actionlog", "#actionlog"); $("#show_actionlog").click(getActionLog); $("#actionlog_filter").click(function() { + var tbl = $("#actionlog table"); var actions = $(this).val(); $("#actionlog tbody").remove(); var entries = []; - $("#actionlog table").data("allentries").forEach(function(e) { + tbl.data("allentries").forEach(function(e) { if(actions.indexOf(e.action) == -1) return; entries.push(e); @@ -398,7 +399,7 @@ function setupCallbacks() { var x = a.name, y = b.name; return x == y ? 0 : (x < y ? -1 : 1); } - return a.usercount < b.usercount ? -1 : 1; + return a.usercount < b.usercount ? 1 : -1; }); var total = 0; data.forEach(function(c) {