diff options
author | Kim Alvefur <zash@zash.se> | 2015-11-24 19:09:51 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2015-11-24 19:09:51 +0100 |
commit | 35fd8b8fda620eb94d0f9d7161cac7fd890db862 (patch) | |
tree | e4f4f79752c990a719fbc0c14618ea57510ea5e9 | |
parent | 7d3ecdd4ed165ec2fc86dbc5ffd0e4e2feba76f0 (diff) | |
download | prosody-35fd8b8fda620eb94d0f9d7161cac7fd890db862.tar.gz prosody-35fd8b8fda620eb94d0f9d7161cac7fd890db862.zip |
util.session: What is the identity of a session?
-rw-r--r-- | util/session.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/util/session.lua b/util/session.lua index 735b6165..6993842c 100644 --- a/util/session.lua +++ b/util/session.lua @@ -6,6 +6,13 @@ local function new_session(typ) return session; end +local function set_id(session) + local id = typ .. tostring(session):match("%x+$"):lower(); + session.id = id; + return session; +end + return { new = new_session; + set_id = set_id; } |