fh:close()
end
+local function mirror_new_msg(mirror_dir, msg)
+ local fname = msg.number .. "--" .. msg.date .. "-" ..
+ msg.from .. ".txt"
+ local fh = assert(io.open(mirror_dir .. "/" .. fname, "w"))
+
+ local header = msg.subject .. " (" .. msg.from .. ", " .. msg.date .. ")"
+ fh:write(header .. "\n")
+ fh:write(string.rep("-",#header) .. "\n\n")
+ fh:write(msg.text .. "\n")
+ fh:close()
+end
+
+
--- QWK formatting ---
local qwk = {}
append_new_msg(conf_num, msg)
- print("Processed message for conference " .. qb.conferences[conf_num+1] .. ".")
+ local conf_name = qb.conferences[conf_num+1]
+
+ print("Processed message for conference " .. conf_name .. ".")
+
+ if qb.conference_mirrors and qb.conference_mirrors[conf_name] then
+ mirror_new_msg(qb.conference_mirrors[conf_name], msg)
+ end
+
end
--- Commands ---
"Meta"
}
+-- Use the following table to specify directories
+-- to mirror conference contents to in a plain text
+-- format suitable for a BBS phlog:
+-- qb.conference_mirrors = {
+-- ["Meta"] = "/path/to/mirror"
+-- }
+
-- Ensure these point to zip and unzip on your system
qb.zip = "/usr/bin/zip"
qb.unzip = "/usr/bin/unzip"
to their neigh entry in the /etc/nncp.hjson file
exec: {
- offline: ["/usr/local/bin/qwikboard", "/var/bbs/" "nncp_handler"]
+ offline: ["/usr/local/bin/qwikboard", "/var/bbs/", "nncp_handler"]
}]]
return false
end