aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_smacks.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-12-22 18:47:45 +0100
committerKim Alvefur <zash@zash.se>2021-12-22 18:47:45 +0100
commit2f3b28380a3c68e48bd0e1a159f6bcdee7cad19f (patch)
treeb19b1bd26986477f1452089e1805865127b343e1 /plugins/mod_smacks.lua
parentb332a2aa42b611f82dc487d67ab727f2bfc96478 (diff)
downloadprosody-2f3b28380a3c68e48bd0e1a159f6bcdee7cad19f.tar.gz
prosody-2f3b28380a3c68e48bd0e1a159f6bcdee7cad19f.zip
mod_smacks: Use more compact resumption tokens
UUID seems like insane overkill for something user-scoped and not security-sensitive. All that is needed is to avoid conflicts among what should be relatively long-lived sessions.
Diffstat (limited to 'plugins/mod_smacks.lua')
-rw-r--r--plugins/mod_smacks.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/mod_smacks.lua b/plugins/mod_smacks.lua
index c52b268c..677b69fc 100644
--- a/plugins/mod_smacks.lua
+++ b/plugins/mod_smacks.lua
@@ -21,7 +21,7 @@ local jid = require "util.jid";
local smqueue = require "util.smqueue";
local st = require "util.stanza";
local timer = require "util.timer";
-local uuid_generate = require "util.uuid".generate;
+local new_id = require "util.id".short;
local watchdog = require "util.watchdog";
local sessionmanager = require "core.sessionmanager";
@@ -259,7 +259,7 @@ function handle_enable(session, stanza, xmlns_sm)
local resume_token;
local resume = stanza.attr.resume;
if resume == "true" or resume == "1" then
- resume_token = uuid_generate();
+ resume_token = new_id();
session_registry[jid.join(session.username, session.host, resume_token)] = session;
session.resumption_token = resume_token;
resume_max = tostring(resume_timeout);