diff --git a/core/mrc.js b/core/mrc.js index 496e7e9b..11533dbd 100644 --- a/core/mrc.js +++ b/core/mrc.js @@ -379,7 +379,9 @@ exports.getModule = class mrcModule extends MenuModule { } // Deliver PrivMsg - else if (message.to_user.toLowerCase() == this.state.alias.toLowerCase()) { + else if ( + message.to_user.toLowerCase() == this.state.alias.toLowerCase() + ) { const currentTime = moment().format( this.client.currentTheme.helpers.getTimeFormat() ); @@ -387,8 +389,6 @@ exports.getModule = class mrcModule extends MenuModule { '|08' + currentTime + '|00 ' + message.body + '|00' ); } - - } this.viewControllers.mrcChat.switchFocus(MciViewIds.mrcChat.inputArea); @@ -563,47 +563,35 @@ exports.getModule = class mrcModule extends MenuModule { * Process known additional server commands directly */ case 'afk': - this.sendServerMessage( - `AFK ${message.substr(5)}` - ); + this.sendServerMessage(`AFK ${message.substr(5)}`); break; case 'roomconfig': - this.sendServerMessage( - `ROOMCONFIG ${message.substr(12)}` - ); + this.sendServerMessage(`ROOMCONFIG ${message.substr(12)}`); break; case 'roompass': - this.sendServerMessage( - `ROOMPASS ${message.substr(12)}` - ); + this.sendServerMessage(`ROOMPASS ${message.substr(12)}`); break; case 'status': - this.sendServerMessage( - `STATUS ${message.substr(8)}` - ); + this.sendServerMessage(`STATUS ${message.substr(8)}`); break; case 'lastseen': - this.sendServerMessage( - `LASTSEEN ${message.substr(10)}` - ); + this.sendServerMessage(`LASTSEEN ${message.substr(10)}`); break; - + case 'help': - this.sendServerMessage( - `HELP ${message.substr(6)}` - ); + this.sendServerMessage(`HELP ${message.substr(6)}`); break; - + case 'statistics': case 'changelog': case 'listbans': case 'listmutes': case 'routing': - this.sendServerMessage(cmd[0].toUpperCase()); + this.sendServerMessage(cmd[0].toUpperCase()); break; case 'quit': diff --git a/core/oputil/oputil_help.js b/core/oputil/oputil_help.js index 22ed520a..f13690b6 100644 --- a/core/oputil/oputil_help.js +++ b/core/oputil/oputil_help.js @@ -182,6 +182,8 @@ General Information: MessageBase: `usage: oputil.js mb [] Actions: + list-confs List conferences and areas + areafix CMD1 CMD2 ... ADDR Sends an AreaFix NetMail NetMail is sent to supplied address with the supplied command(s). Multi-part commands @@ -194,6 +196,9 @@ Actions: packet in the directory specified by PATH. The QWK BBS ID will be obtained by the final component of PATH. +list-confs arguments: + --areas Include areas within each message conference. + import-areas arguments: --conf CONF_TAG Conference tag in which to import areas --network NETWORK Network name/key to associate FTN areas diff --git a/core/oputil/oputil_message_base.js b/core/oputil/oputil_message_base.js index 38f5e529..36cde188 100644 --- a/core/oputil/oputil_message_base.js +++ b/core/oputil/oputil_message_base.js @@ -692,6 +692,30 @@ function exportQWKPacket() { ); } +const listConferences = () => { + initConfigAndDatabases(err => { + if (err) { + return console.error(err.reason ? err.reason : err.message); + } + + const { getSortedAvailMessageConferences } = require('../../core/message_area'); + + const conferences = getSortedAvailMessageConferences(null, { noClient: true }); + + for (let conf of conferences) { + console.info(`${conf.confTag} - ${conf.conf.name}`); + + if (!argv.areas) { + continue; + } + + for (let areaTag of Object.keys(conf.conf.areas)) { + console.info(` ${areaTag} - ${conf.conf.areas[areaTag].name}`); + } + } + }); +}; + function handleMessageBaseCommand() { function errUsage() { return printUsageAndSetExitCode(getHelpFor('MessageBase'), ExitCodes.ERROR); @@ -709,6 +733,7 @@ function handleMessageBaseCommand() { 'import-areas': importAreas, 'qwk-dump': dumpQWKPacket, 'qwk-export': exportQWKPacket, + 'list-confs': listConferences, }[action] || errUsage )(); }