aboutsummaryrefslogtreecommitdiffstats
path: root/util/session.lua
diff options
context:
space:
mode:
Diffstat (limited to 'util/session.lua')
-rw-r--r--util/session.lua12
1 files changed, 10 insertions, 2 deletions
diff --git a/util/session.lua b/util/session.lua
index 25b22faf..1d03fa54 100644
--- a/util/session.lua
+++ b/util/session.lua
@@ -1,10 +1,12 @@
-local initialize_filters = require "util.filters".initialize;
-local logger = require "util.logger";
+local initialize_filters = require "prosody.util.filters".initialize;
+local time = require "util.time";
+local logger = require "prosody.util.logger";
local function new_session(typ)
local session = {
type = typ .. "_unauthed";
base_type = typ;
+ since = time.now();
};
return session;
end
@@ -57,10 +59,16 @@ local function set_send(session)
return session;
end
+local function set_role(session, role)
+ session.role = role;
+end
+
return {
new = new_session;
+
set_id = set_id;
set_logger = set_logger;
set_conn = set_conn;
set_send = set_send;
+ set_role = set_role;
}