diff options
author | Badlop <badlop@process-one.net> | 2015-05-05 12:46:21 +0200 |
---|---|---|
committer | Badlop <badlop@process-one.net> | 2015-05-05 12:46:21 +0200 |
commit | 96c62acb1b9c6b307ec37a1ad1041589c2b7375a (patch) | |
tree | 0d8451148cac46ff8e0367408b79f5132eebcd84 /src | |
parent | Fix set_last command to work with recent ejabberd (#555) (diff) |
Improve get_last command to provide also last activity status
Diffstat (limited to 'src')
-rw-r--r-- | src/mod_admin_extra.erl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mod_admin_extra.erl b/src/mod_admin_extra.erl index 12270a54a..75233a732 100644 --- a/src/mod_admin_extra.erl +++ b/src/mod_admin_extra.erl @@ -435,7 +435,7 @@ commands() -> result = {res, rescode}}, #ejabberd_commands{name = get_last, tags = [last], - desc = "Get last activity information", + desc = "Get last activity information (timestamp and status)", longdesc = "Timestamp is the seconds since" "1970-01-01 00:00:00 UTC, for example: date +%s", module = ?MODULE, function = get_last, @@ -1226,7 +1226,7 @@ get_last(User, Server) -> case Mod:get_last_info(User, Server) of not_found -> "Never"; - {ok, Shift, _Status} -> + {ok, Shift, Status} -> TimeStamp = {Shift div 1000000, Shift rem 1000000, 0}, @@ -1234,8 +1234,8 @@ get_last(User, Server) -> calendar:now_to_local_time(TimeStamp), lists:flatten( io_lib:format( - "~w-~.2.0w-~.2.0w ~.2.0w:~.2.0w:~.2.0w", - [Year, Month, Day, Hour, Minute, Second])) + "~w-~.2.0w-~.2.0w ~.2.0w:~.2.0w:~.2.0w ~s", + [Year, Month, Day, Hour, Minute, Second, Status])) end; _ -> "Online" |