aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2015-11-24 19:09:51 +0100
committerKim Alvefur <zash@zash.se>2015-11-24 19:09:51 +0100
commit3bf4a8eef76681cf3ef9dd4421a045c69cbfe860 (patch)
treee4f4f79752c990a719fbc0c14618ea57510ea5e9 /util
parentcf7c286cfbc879121126248d21bef70dfec2e5bc (diff)
downloadprosody-3bf4a8eef76681cf3ef9dd4421a045c69cbfe860.tar.gz
prosody-3bf4a8eef76681cf3ef9dd4421a045c69cbfe860.zip
util.session: What is the identity of a session?
Diffstat (limited to 'util')
-rw-r--r--util/session.lua7
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;
}