Skip to content
Snippets Groups Projects
Commit a72a3e79 authored by rswindell's avatar rswindell
Browse files

A simple message base test script right now, but ultimately could (should)

grow into something that could be used in lieu of smbutil for at least
some message base admin functions. Committing in its current form for
Bill McGarrity to use to help diagnose a Message-ID issue (w/newslink.js)
parent ec971ee4
Branches
Tags
No related merge requests found
// $Id$
load('sbbsdefs.js');
function show_index(msgbase, first_msg, last_msg, include_votes)
{
var i;
var total_msgs = msgbase.total_msgs;
for(i = 0; i < total_msgs; i++) {
// print(i);
var idx = msgbase.get_msg_index(true, i, include_votes);
if(!idx)
continue;
print(i);
var p;
for(p in idx)
print(format("%10s = ", p) + idx[p]);
}
}
function show_headers(msgbase, include_votes)
{
alert("include votes = " + include_votes);
var hdrs = msgbase.get_all_msg_headers(include_votes);
var i;
for(i in hdrs) {
var h;
print(i);
for(h in hdrs[i])
print(format("%25s = ", h) + hdrs[i][h]);
}
}
var i;
var basecode;
var option = [];
for(i in argv)
if(argv[i].charAt(0) != '-') {
if(!basecode)
basecode = argv[i];
} else
option[argv[i].slice(1)] = true;
if(basecode == undefined) {
alert("Message base not specified");
exit();
}
var start = time();
var msgbase = MsgBase(basecode);
if(!msgbase.open()) {
alert("Error " + msgbase.last_error + " opening " + basecode);
exit();
}
show_index(msgbase, msgbase.first_msg, msgbase.last_msg, option.votes);
show_headers(msgbase, option.votes);
print(Number(time() - start) + " seconds");
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment