# HG changeset patch # User Kim Alvefur # Date 1448388591 -3600 # Node ID 9df70e9e006b4622c9a6cc963917392bb02a2086 # Parent f5d2e58fbefa0238d982efd0bf89e20bbecf11bb util.session: What is the identity of a session? diff -r f5d2e58fbefa -r 9df70e9e006b util/session.lua --- a/util/session.lua Tue Nov 24 19:00:43 2015 +0100 +++ b/util/session.lua Tue Nov 24 19:09:51 2015 +0100 @@ -6,6 +6,13 @@ 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; }