Merge branch 'master' of ssh://numinibsd/git/base/enigma-bbs
This commit is contained in:
commit
97cd0c3063
|
@ -557,17 +557,24 @@ exports.getModule = class GopherModule extends ServerModule {
|
||||||
this.makeItem(ItemTypes.InfoMessage, `Messages in ${area.name}`),
|
this.makeItem(ItemTypes.InfoMessage, `Messages in ${area.name}`),
|
||||||
this.makeItem(ItemTypes.InfoMessage, '(newest first)'),
|
this.makeItem(ItemTypes.InfoMessage, '(newest first)'),
|
||||||
this.makeItem(ItemTypes.InfoMessage, '-'.repeat(70)),
|
this.makeItem(ItemTypes.InfoMessage, '-'.repeat(70)),
|
||||||
...msgList.map(msg =>
|
...msgList.map(msg => {
|
||||||
this.makeItem(
|
let m;
|
||||||
|
try {
|
||||||
|
m = moment(msg.modTimestamp);
|
||||||
|
} catch (e) {
|
||||||
|
this.log.warn(
|
||||||
|
`Error parsing "${msg.modTimestamp}"; expected timestamp: ${e.message}`
|
||||||
|
);
|
||||||
|
m = moment();
|
||||||
|
}
|
||||||
|
return this.makeItem(
|
||||||
ItemTypes.TextFile,
|
ItemTypes.TextFile,
|
||||||
`${moment(msg.modTimestamp).format(
|
`${m.format('YYYY-MM-DD hh:mma')}: ${this.shortenSubject(
|
||||||
'YYYY-MM-DD hh:mma'
|
msg.subject
|
||||||
)}: ${this.shortenSubject(msg.subject)} (${
|
)} (${msg.fromUserName} to ${msg.toUserName})`,
|
||||||
msg.fromUserName
|
|
||||||
} to ${msg.toUserName})`,
|
|
||||||
`/msgarea/${confTag}/${areaTag}/${msg.messageUuid}`
|
`/msgarea/${confTag}/${areaTag}/${msg.messageUuid}`
|
||||||
)
|
);
|
||||||
),
|
}),
|
||||||
].join('');
|
].join('');
|
||||||
|
|
||||||
this.log.debug({ confTag, areaTag }, 'Gopher serving message list');
|
this.log.debug({ confTag, areaTag }, 'Gopher serving message list');
|
||||||
|
|
Loading…
Reference in New Issue