Mercurial > prosody-modules
diff mod_statistics/mod_statistics.lua @ 1074:cccd9f6a628d
mod_statistics: Better detection of when running under prosody vs prosodyctl
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 15 Jun 2013 20:36:23 +0100 |
parents | 4dbdb1b465e8 |
children | 7dbde05b48a9 |
line wrap: on
line diff
--- a/mod_statistics/mod_statistics.lua Sat Jun 15 20:16:58 2013 +0100 +++ b/mod_statistics/mod_statistics.lua Sat Jun 15 20:36:23 2013 +0100 @@ -95,7 +95,9 @@ end function module.load() - if not(prosody and prosody.full_sessions) then return; end --FIXME: hack, need a proper flag + if not(prosody and prosody.arg) then + return; + end filters.add_filter_hook(stats.filter_hook); module:add_timer(1, function () @@ -115,10 +117,7 @@ end return 1; end); - module:provides("net", { - default_port = 5782; - listener = listener; - }); + end function module.unload() filters.remove_filter_hook(stats.filter_hook); @@ -132,3 +131,11 @@ prosodytop.run(); end end + +if prosody and prosody.arg then + module:provides("net", { + default_port = 5782; + listener = listener; + private = true; + }); +end