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 | 3bf4a8eef76681cf3ef9dd4421a045c69cbfe860 (patch) | |
tree | e4f4f79752c990a719fbc0c14618ea57510ea5e9 | |
parent | cf7c286cfbc879121126248d21bef70dfec2e5bc (diff) | |
download | prosody-3bf4a8eef76681cf3ef9dd4421a045c69cbfe860.tar.gz prosody-3bf4a8eef76681cf3ef9dd4421a045c69cbfe860.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; } |