Comparison

util/session.lua @ 13007:534c055ec378

util.session: Add 'since' property with timestamp of session creation
author Matthew Wild <mwild1@gmail.com>
date Wed, 29 Mar 2023 13:01:28 +0100
parent 12975:d10957394a3c
child 13165:9c13c11b199d
comparison
equal deleted inserted replaced
13006:d943733c6d01 13007:534c055ec378
1 local initialize_filters = require "prosody.util.filters".initialize; 1 local initialize_filters = require "prosody.util.filters".initialize;
2 local time = require "util.time";
2 local logger = require "prosody.util.logger"; 3 local logger = require "prosody.util.logger";
3 4
4 local function new_session(typ) 5 local function new_session(typ)
5 local session = { 6 local session = {
6 type = typ .. "_unauthed"; 7 type = typ .. "_unauthed";
7 base_type = typ; 8 base_type = typ;
9 since = time.now();
8 }; 10 };
9 return session; 11 return session;
10 end 12 end
11 13
12 local function set_id(session) 14 local function set_id(session)