- BREAKING CHANGE from v0.9.35 and eariler: Move accounts into subfolder of SessionStore
 - viewergen and viewer updates from @GraspYonOx
 - new homepage theme inspired by @GraspYonOx
 - connect setup also mostly by @GraspYonOx
 - numerous bug fixes
 - nntp-server-zefie is now on npmjs
 - implement proper nodejs debugging
   - will start to phase out using console.log for actual debugging
   - existing "debug" (verbose) messages will stay as is
   - future code debugging will use debug() to debug WIP, therefore not showing to most users if it is accidently left in
This commit is contained in:
zefie
2022-10-16 18:58:30 -04:00
parent b89e0e932c
commit c2a3081afd
91 changed files with 1653 additions and 1694 deletions

View File

@@ -96,7 +96,7 @@ class WTVMail {
}
mailboxExists(mailboxid) {
if (mailboxid > this.mailboxes.length) return null;
if (mailboxid >= this.mailboxes.length) return null;
var mailbox_dir = null;
if (this.mailstoreExists()) {
var mailbox_name = this.getMailboxById(mailboxid);
@@ -182,7 +182,7 @@ class WTVMail {
}
try {
if (this.fs.existsSync(message_file_out)) {
console.log(" * ERROR: Message with this UUID (" + messageid + ") already exists (should never happen). Message lost.");
console.error(" * ERROR: Message with this UUID (" + messageid + ") already exists (should never happen). Message lost.");
return false;
}
@@ -389,7 +389,7 @@ class WTVMail {
var temp_session_data_file = self.fs.readFileSync(search_dir + self.path.sep + file, 'Utf8');
var temp_session_data = JSON.parse(temp_session_data_file);
if (temp_session_data.subscriber_username.toLowerCase() == username.toLowerCase()) {
return_val = search_dir.replace(this.minisrv_config.config.SessionStore + self.path.sep, '').replace("user", '').split(self.path.sep);
return_val = search_dir.replace(this.minisrv_config.config.SessionStore + self.path.sep + "accounts" + self.path.sep, '').replace("user", '').split(self.path.sep);
return_val.push(temp_session_data.subscriber_name);
}
} catch (e) {
@@ -437,7 +437,7 @@ class WTVMail {
// check if the destination user's Inbox exists yet
if (!dest_user_mailstore.mailboxExists(0)) {
// mailbox does not yet exist, create it
var mailbox_exists = dest_user_mailstore.createMailbox(mailbox);
var mailbox_exists = dest_user_mailstore.createMailbox(0);
// Just created Inbox for the first time, so create the welcome message
if (mailbox_exists) dest_user_mailstore.createWelcomeMessage();
}