Software /
code /
prosody-modules
Diff
mod_statistics/stats.lib.lua @ 1080:3af947e2e6d4
mod_statistics/stats.lib.lua: Only fetch shared tables if running under Prosody
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sat, 15 Jun 2013 21:17:09 +0100 |
parent | 1077:b73d44afdafa |
child | 1081:3e2c4f424797 |
line wrap: on
line diff
--- a/mod_statistics/stats.lib.lua Sat Jun 15 21:02:48 2013 +0100 +++ b/mod_statistics/stats.lib.lua Sat Jun 15 21:17:09 2013 +0100 @@ -27,8 +27,10 @@ local get_time = require "socket".gettime; local active_sessions, active_jids = {}, {}; -local s2s_sessions = module:shared"/*/s2s/sessions"; -local c2s_sessions = module:shared"/*/c2s/sessions"; +local c2s_sessions, s2s_sessions; +if prosody and prosody.arg then + c2s_sessions, s2s_sessions = module:shared("/*/c2s/sessions", "/*/s2s/sessions"); +end local stats = { total_users = {