aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_csi_simple.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-11-27 19:05:11 +0100
committerKim Alvefur <zash@zash.se>2018-11-27 19:05:11 +0100
commit6e6f343e47418b0c01d776d5fbd4ec18247bbdab (patch)
tree32196290e1363e3cfccb4d5be6ceed008aa71d76 /plugins/mod_csi_simple.lua
parentda124be92e7f1dca4942fe1c973faa400058e3e5 (diff)
downloadprosody-6e6f343e47418b0c01d776d5fbd4ec18247bbdab.tar.gz
prosody-6e6f343e47418b0c01d776d5fbd4ec18247bbdab.zip
mod_csi_simple: Bypass importance event in active mode (fixes #1249)
Diffstat (limited to 'plugins/mod_csi_simple.lua')
-rw-r--r--plugins/mod_csi_simple.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/mod_csi_simple.lua b/plugins/mod_csi_simple.lua
index 551b13c0..99e4408d 100644
--- a/plugins/mod_csi_simple.lua
+++ b/plugins/mod_csi_simple.lua
@@ -71,6 +71,7 @@ end, -1);
module:hook("csi-client-inactive", function (event)
local session = event.origin;
+ session.state = "inactive";
if session.pump then
session.pump:pause();
else
@@ -81,7 +82,7 @@ module:hook("csi-client-inactive", function (event)
pump:pause();
session.pump = pump;
function session.send(stanza)
- if module:fire_event("csi-is-stanza-important", { stanza = stanza, session = session }) then
+ if session.state == "active" or module:fire_event("csi-is-stanza-important", { stanza = stanza, session = session }) then
pump:flush();
send(stanza);
else
@@ -98,6 +99,7 @@ end);
module:hook("csi-client-active", function (event)
local session = event.origin;
+ session.state = "active";
if session.pump then
session.pump:resume();
end