aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-03-24 20:43:15 +0100
committerKim Alvefur <zash@zash.se>2019-03-24 20:43:15 +0100
commit0c520e8a39f380940ad216a228eb0624d85e02bd (patch)
treee01b462dfb32040cbfd17218858d6670f28fdb48 /plugins
parent8ad3c66121ddc50c102061c9365411545d660625 (diff)
downloadprosody-0c520e8a39f380940ad216a228eb0624d85e02bd.tar.gz
prosody-0c520e8a39f380940ad216a228eb0624d85e02bd.zip
mod_csi_simple: Disable optimizations on unload and re-enable on load
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_csi_simple.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/plugins/mod_csi_simple.lua b/plugins/mod_csi_simple.lua
index 14abbc68..d0de222e 100644
--- a/plugins/mod_csi_simple.lua
+++ b/plugins/mod_csi_simple.lua
@@ -111,3 +111,24 @@ module:hook("c2s-ondrain", function (event)
session.conn:pause_writes();
end
end);
+
+function module.load()
+ for _, user_session in pairs(prosody.hosts[module.host].sessions) do
+ for _, session in pairs(user_session.sessions) do
+ if session.state == "inactive" then
+ enable_optimizations(session);
+ end
+ end
+ end
+end
+
+function module.unload()
+ for _, user_session in pairs(prosody.hosts[module.host].sessions) do
+ for _, session in pairs(user_session.sessions) do
+ if session.state == "inactive" then
+ disble_optimizations(session);
+ end
+ end
+ end
+end
+