mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-07-26 04:28:17 +02:00
* Fix hard line feeds @ FTN import/export
* Retain Origin and tear lines in imported messages
This commit is contained in:
parent
0a0468bb12
commit
4e21901be7
4 changed files with 32 additions and 21 deletions
|
@ -169,8 +169,10 @@ exports.PacketHeader = PacketHeader;
|
|||
// * Writeup on differences between type 2, 2.2, and 2+:
|
||||
// http://walon.org/pub/fidonet/FTSC-nodelists-etc./pkt-types.txt
|
||||
//
|
||||
function Packet() {
|
||||
function Packet(options) {
|
||||
var self = this;
|
||||
|
||||
this.options = options || {};
|
||||
|
||||
this.parsePacketHeader = function(packetBuffer, cb) {
|
||||
assert(Buffer.isBuffer(packetBuffer));
|
||||
|
@ -574,6 +576,10 @@ function Packet() {
|
|||
|
||||
if(messageBodyData.tearLine) {
|
||||
msg.meta.FtnProperty.ftn_tear_line = messageBodyData.tearLine;
|
||||
|
||||
if(self.options.keepTearAndOrigin) {
|
||||
msg.message += `\r\n${messageBodyData.tearLine}\r\n`;
|
||||
}
|
||||
}
|
||||
|
||||
if(messageBodyData.seenBy.length > 0) {
|
||||
|
@ -586,6 +592,10 @@ function Packet() {
|
|||
|
||||
if(messageBodyData.originLine) {
|
||||
msg.meta.FtnProperty.ftn_origin = messageBodyData.originLine;
|
||||
|
||||
if(self.options.keepTearAndOrigin) {
|
||||
msg.message += `${messageBodyData.originLine}\r\n`;
|
||||
}
|
||||
}
|
||||
|
||||
const nextBuf = packetBuffer.slice(read);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue