aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_smacks.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-12-01 16:26:53 +0100
committerKim Alvefur <zash@zash.se>2021-12-01 16:26:53 +0100
commit15ef5fb400c95fe3c1f9a4eab893f7afa7390167 (patch)
treedb310a9bbf7274e1375d16264170e23a8b69b6bd /plugins/mod_smacks.lua
parentb9a8bc11481aee72e6fc57af3fa972dc2544b169 (diff)
downloadprosody-15ef5fb400c95fe3c1f9a4eab893f7afa7390167.tar.gz
prosody-15ef5fb400c95fe3c1f9a4eab893f7afa7390167.zip
mod_smacks: Remove redundant fields
Given that the registry is scoped per user and the module is scoped per host, there seems no point to checking or storing both username and host here.
Diffstat (limited to 'plugins/mod_smacks.lua')
-rw-r--r--plugins/mod_smacks.lua8
1 files changed, 1 insertions, 7 deletions
diff --git a/plugins/mod_smacks.lua b/plugins/mod_smacks.lua
index 4ec83897..25d5dde2 100644
--- a/plugins/mod_smacks.lua
+++ b/plugins/mod_smacks.lua
@@ -82,8 +82,6 @@ local session_registry = init_session_cache(max_hibernated_sessions, function(re
-- save only actual h value and username/host (for security)
old_session_registry.set(session.username, resumption_token, {
h = session.handled_stanza_count,
- username = session.username,
- host = session.host
});
return true; -- allow session to be removed from full cache to make room for new one
end);
@@ -507,8 +505,6 @@ module:hook("pre-resource-unbind", function (event)
-- save only actual h value and username/host (for security)
old_session_registry.set(session.username, session.resumption_token, {
h = session.handled_stanza_count,
- username = session.username,
- host = session.host
});
session.resumption_token = nil;
sessionmanager.destroy_session(session);
@@ -558,9 +554,7 @@ function handle_resume(session, stanza, xmlns_sm)
if not original_session then
session.log("debug", "Tried to resume non-existent session with id %s", id);
local old_session = old_session_registry.get(session.username, id);
- if old_session and session.username == old_session.username
- and session.host == old_session.host
- and old_session.h then
+ if old_session then
session.send(st.stanza("failed", { xmlns = xmlns_sm, h = format_h(old_session.h) })
:tag("item-not-found", { xmlns = xmlns_errors })
);