aboutsummaryrefslogtreecommitdiffstats
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
commit35fd8b8fda620eb94d0f9d7161cac7fd890db862 (patch)
treee4f4f79752c990a719fbc0c14618ea57510ea5e9
parent7d3ecdd4ed165ec2fc86dbc5ffd0e4e2feba76f0 (diff)
downloadprosody-35fd8b8fda620eb94d0f9d7161cac7fd890db862.tar.gz
prosody-35fd8b8fda620eb94d0f9d7161cac7fd890db862.zip
util.session: What is the identity of a session?
-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;
}