Commits (5)
......@@ -56,7 +56,8 @@ function list(filename, verbose)
try {
list = Archive(filename).list(Boolean(verbose));
} catch(e) {
alert(file_getname(filename) + ": Unsupported archive format");
log(LOG_NOTICE, filename + " " + e);
alert(file_getname(filename) + ": Unsupported archive");
return;
}
......
......@@ -133,11 +133,12 @@ for(var i in dir_list) {
}
} catch(e) { }
if(contents) {
var key = JSON.stringify(contents);
var key = sha1_calc(JSON.stringify(contents));
if(!arc[key])
arc[key] = [];
arc[key].push(file);
}
contents = undefined;
}
total_bytes += file.size;
}
......
......@@ -15,7 +15,7 @@ const ini_section = "netmail sent";
const NetmailAddressHistoryLength = 10;
while(bbs.online && !console.aborted) {
while(bbs.online) {
if(!(user.settings & USER_EXPERT))
bbs.menu("e-mail");
bbs.nodesync();
......@@ -42,7 +42,7 @@ while(bbs.online && !console.aborted) {
wm_mode = WM_FILE;
case 'S': // Send Mail
console.putmsg(bbs.text(text.Email));
var name = console.getstr(40);
var name = console.getstr(40, K_TRIM);
if(!name)
break;
if(name.indexOf('@') > 0) {
......@@ -50,6 +50,8 @@ while(bbs.online && !console.aborted) {
break;
}
var number = bbs.finduser(name);
if(console.aborted)
break;
if(!number)
number = system.matchuser(name);
if(!number && (msg_area.settings&MM_REALNAME))
......@@ -68,7 +70,7 @@ while(bbs.online && !console.aborted) {
break;
console.putmsg(bbs.text(text.EnterNetMailAddress));
var addr_list = userprops.get(ini_section, "address", []) || [];
var addr = console.getstr(256, K_LINE, addr_list);
var addr = console.getstr(256, K_LINE | K_TRIM, addr_list);
if(!addr || console.aborted)
break;
if(bbs.netmail(addr.split(','), wm_mode)) {
......@@ -82,8 +84,7 @@ while(bbs.online && !console.aborted) {
userprops.set(ini_section, "localtime", new Date().toString());
}
break;
case 'Q': // Quit
case '\r':
default:
exit(0);
case '?': // Display menu
if(user.settings & USER_EXPERT)
......
......@@ -197,6 +197,8 @@ while(bbs.online && !console.aborted) {
count = new Archive(path).extract(system.temp_dir);
} catch(e) {
log(LOG_INFO, e);
alert(e);
break;
}
base.close();
if(count) {
......
......@@ -2,6 +2,7 @@ if(argc < 1) {
alert("No directory code specfiied");
exit(0);
}
var options = { force: true };
var fbase = new FileBase(argv[0]);
if(!fbase.open()) {
alert("failed to open base");
......@@ -10,6 +11,11 @@ if(!fbase.open()) {
var file_list = fbase.get_list(argv[1] || "*", FileBase.DETAIL.NORM);
for(var i in file_list) {
var file = file_list[i];
if(options.force) {
print("Updating " + file.name);
fbase.update(file.name, file, /* use_diz_always: */true, /* re-add: */true);
continue;
}
var copy = JSON.parse(JSON.stringify(file));
for(var p in file) {
var str = prompt(p + " [" + file[p] + "]");
......