mod_csi: Set session.state to simplify CSI modules

Moved here from mod_csi_simple
This commit is contained in:
Kim Alvefur 2018-11-27 19:34:21 +01:00
parent 64b9b5a758
commit a24712e845
2 changed files with 1 additions and 2 deletions

View file

@ -11,6 +11,7 @@ end);
function refire_event(name)
return function (event)
if event.origin.username then
session.state = event.stanza.name;
module:fire_event(name, event);
return true;
end

View file

@ -71,7 +71,6 @@ end, -1);
module:hook("csi-client-inactive", function (event)
local session = event.origin;
session.state = "inactive";
if session.pump then
session.pump:pause();
else
@ -99,7 +98,6 @@ end);
module:hook("csi-client-active", function (event)
local session = event.origin;
session.state = "active";
if session.pump then
session.pump:resume();
end