Software /
code /
prosody-modules
Diff
mod_pastebin/mod_pastebin.lua @ 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 |
parent | 516:3d3687fef751 |
child | 565:9c2eea631811 |
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