diff --git a/abrechenbarkeit.lua b/abrechenbarkeit.lua index f5b48a0..b7636a1 100755 --- a/abrechenbarkeit.lua +++ b/abrechenbarkeit.lua @@ -530,7 +530,11 @@ local function r_log(filter) end) end -local function r_users(show_special) +local function r_users(show_special, filter_negative) + if filter_negative ~= nil then + filter_negative = tonumber(filter_negative) or 0 + end + return respond(200, "Abrechenbarkeit", function() local users = get_active_users() @@ -579,7 +583,8 @@ local function r_users(show_special) local show_user = function(user) local is_spu = user.name:sub(1, 1) == "@" local filter_out = query.prefix ~= nil and user.name:sub(1, 1):lower() ~= query.prefix - if is_spu == show_special and not filter_out then + if (filter_negative ~= nil and user.balance < filter_negative) + or (filter_negative == nil and is_spu == show_special and not filter_out) then print(format([[