diff options
Diffstat (limited to 'plugins/mod_dialback.lua')
-rw-r--r-- | plugins/mod_dialback.lua | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/plugins/mod_dialback.lua b/plugins/mod_dialback.lua index b32160c4..2959358b 100644 --- a/plugins/mod_dialback.lua +++ b/plugins/mod_dialback.lua @@ -19,7 +19,15 @@ local xmlns_stream = "http://etherx.jabber.org/streams"; local dialback_requests = setmetatable({}, { __mode = 'v' }); -local dialback_secret = module.host .. (module:get_option_string("dialback_secret") or uuid_gen()); +local dialback_secret = module.host .. module:get_option_string("dialback_secret", uuid_gen()); + +function module.save() + return { dialback_secret = dialback_secret }; +end + +function module.restore(state) + dialback_secret = state.dialback_secret; +end function generate_dialback(id, to, from) return sha256_hash(id..to..dialback_secret, true); |