Very slight display improvements, include conf in info

This commit is contained in:
Bryan Ashby 2020-05-12 09:12:55 -06:00
parent fbec46d1b9
commit f63464c501
No known key found for this signature in database
GPG Key ID: B49EB437951D2542
2 changed files with 10 additions and 7 deletions

View File

@ -4,6 +4,7 @@ const Message = require('./message');
const { Errors } = require('./enig_error'); const { Errors } = require('./enig_error');
const { const {
getMessageAreaByTag, getMessageAreaByTag,
getMessageConferenceByTag,
hasMessageConfAndAreaRead, hasMessageConfAndAreaRead,
getAllAvailableMessageAreaTags, getAllAvailableMessageAreaTags,
} = require('./message_area'); } = require('./message_area');
@ -216,7 +217,7 @@ exports.getModule = class MessageBaseQWKExport extends MenuModule {
message, message,
step : 'message', step : 'message',
total : messageIds.length, total : messageIds.length,
status : `Writing message ${current} / ${messageIds.length}`, status : `${_.truncate(message.subject, { length : 25 })} (${current} / ${messageIds.length})`,
}; };
progressHandler(progress, err => { progressHandler(progress, err => {
@ -276,7 +277,8 @@ exports.getModule = class MessageBaseQWKExport extends MenuModule {
}); });
async.eachSeries(userExportAreas, (exportArea, nextExportArea) => { async.eachSeries(userExportAreas, (exportArea, nextExportArea) => {
const area = getMessageAreaByTag(exportArea.areaTag); const area = getMessageAreaByTag(exportArea.areaTag);
if (!area) { const conf = getMessageConferenceByTag(area.confTag);
if (!area || !conf) {
// :TODO: remove from user properties - this area does not exist // :TODO: remove from user properties - this area does not exist
this.client.log.warn({ areaTag : exportArea.areaTag }, 'Cannot QWK export area as it does not exist'); this.client.log.warn({ areaTag : exportArea.areaTag }, 'Cannot QWK export area as it does not exist');
return nextExportArea(null); return nextExportArea(null);
@ -288,9 +290,10 @@ exports.getModule = class MessageBaseQWKExport extends MenuModule {
} }
const progress = { const progress = {
conf,
area, area,
step : 'next_area', step : 'next_area',
status : `Gathering messages in ${area.name}...`, status : `Gathering in ${conf.name} - ${area.name}...`,
}; };
progressHandler(progress, err => { progressHandler(progress, err => {

View File

@ -5,6 +5,7 @@ const { splitTextAtTerms } = require('./string_util');
const { const {
getMessageConfTagByAreaTag, getMessageConfTagByAreaTag,
getMessageAreaByTag, getMessageAreaByTag,
getMessageConferenceByTag,
getAllAvailableMessageAreaTags, getAllAvailableMessageAreaTags,
} = require('./message_area'); } = require('./message_area');
const StatLog = require('./stat_log'); const StatLog = require('./stat_log');
@ -1370,10 +1371,9 @@ class QWKPacketWriter extends EventEmitter {
// map areas as conf #\r\nDescription\r\n pairs // map areas as conf #\r\nDescription\r\n pairs
areas.forEach(area => { areas.forEach(area => {
const conferenceNumber = this._getMessageConferenceNumberByAreaTag(area.areaTag); const conferenceNumber = this._getMessageConferenceNumberByAreaTag(area.areaTag);
let desc = area.name; const conf = getMessageConferenceByTag(area.confTag);
if (area.desc) { const desc = `${conf.name} - ${area.name}`;
desc += ` - ${area.desc}`
}
controlStream.write(`${conferenceNumber}\r\n`); controlStream.write(`${conferenceNumber}\r\n`);
controlStream.write(`${desc}\r\n`); controlStream.write(`${desc}\r\n`);
}); });