Software /
code /
prosody-modules
Changeset
517:f866325305ed
mod_pastebin: Make last commit work (also set on restore)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 21 Dec 2011 10:38:44 +0000 |
parents | 516:3d3687fef751 |
children | 518:d4adda950546 |
files | mod_pastebin/mod_pastebin.lua |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mod_pastebin/mod_pastebin.lua Wed Dec 21 10:25:17 2011 +0000 +++ b/mod_pastebin/mod_pastebin.lua Wed Dec 21 10:38:44 2011 +0000 @@ -143,7 +143,7 @@ httpserver.new{ port = port, base = base, handler = handle_request, ssl = ssl } end -function module.load() +local function set_pastes_metatable() if expire_after == 0 then local dm = require "util.datamanager"; setmetatable(pastes, { @@ -163,10 +163,13 @@ end end +module.load = set_pastes_metatable; + function module.save() return { pastes = pastes }; end function module.restore(data) pastes = data.pastes or pastes; + set_pastes_metatable(); end