equal
deleted
inserted
replaced
37 return string.format("This server has been running for %d day%s, %d hour%s and %d minute%s (since %s)", |
37 return string.format("This server has been running for %d day%s, %d hour%s and %d minute%s (since %s)", |
38 days, (days ~= 1 and "s") or "", hours, (hours ~= 1 and "s") or "", |
38 days, (days ~= 1 and "s") or "", hours, (hours ~= 1 and "s") or "", |
39 minutes, (minutes ~= 1 and "s") or "", os.date("%c", prosody.start_time)); |
39 minutes, (minutes ~= 1 and "s") or "", os.date("%c", prosody.start_time)); |
40 end |
40 end |
41 |
41 |
42 function uptime_command_handler (self, data, state) |
42 function uptime_command_handler () |
43 return { info = uptime_text(), status = "completed" }; |
43 return { info = uptime_text(), status = "completed" }; |
44 end |
44 end |
45 |
45 |
46 local descriptor = adhoc_new("Get uptime", "uptime", uptime_command_handler); |
46 local descriptor = adhoc_new("Get uptime", "uptime", uptime_command_handler); |
47 |
47 |