diff --git a/abrechenbarkeit.lua b/abrechenbarkeit.lua index 41b4e8f..5bdd4ab 100755 --- a/abrechenbarkeit.lua +++ b/abrechenbarkeit.lua @@ -536,8 +536,8 @@ local function r_users(show_special, filter_negative) end return respond(200, "Abrechenbarkeit", function() - local users = get_active_users() - + local users = get_active_users() + if not show_special then print(format([[
]])) - -- get first letters - local firstletters = {} - local function contains(char) - for _, firstchar in ipairs(firstletters) do - if firstchar == char then - return true - end - end + -- get first letters + local firstletters = {} + local function contains(char) + for _, firstchar in ipairs(firstletters) do + if firstchar == char then + return true + end + end - return false - end - - for _, user in ipairs(users) do - user.firstchar = user.name:sub(1,1):lower() - if user.firstchar ~= "@" and not contains(user.firstchar) then - table.insert(firstletters, user.firstchar) - end - end + return false + end - table.sort(firstletters) + for _, user in ipairs(users) do + user.firstchar = user.name:sub(1, 1):lower() + if user.firstchar ~= "@" and not contains(user.firstchar) then + table.insert(firstletters, user.firstchar) + end + end + + table.sort(firstletters) print(format([[