From 02a3963a1239e02735faf7f8f4a662635c198703 Mon Sep 17 00:00:00 2001 From: Deon George Date: Thu, 20 Jul 2023 23:12:26 +1000 Subject: [PATCH] Fix netmail flags for netmails originating here --- app/Classes/FTN/Message.php | 23 ++++++++++++++++++++--- app/Classes/FTN/Process/Netmail/Ping.php | 2 +- app/Jobs/MessageProcess.php | 2 +- app/Notifications/AddressLink.php | 2 +- app/Notifications/NetmailTest.php | 2 +- 5 files changed, 24 insertions(+), 7 deletions(-) diff --git a/app/Classes/FTN/Message.php b/app/Classes/FTN/Message.php index 6ecc7f9..a58e44b 100644 --- a/app/Classes/FTN/Message.php +++ b/app/Classes/FTN/Message.php @@ -52,22 +52,39 @@ class Message extends FTNBase ]; // Flags for messages + /** @var int Private message */ public const FLAG_PRIVATE = 1<<0; + /** @var int Crash priority message (Crash + Hold = Direct) */ public const FLAG_CRASH = 1<<1; + /** @var int Read by addressee */ public const FLAG_RECD = 1<<2; + /** @var int Message has been sent */ public const FLAG_SENT = 1<<3; + /** @var int File attached (filename in subject) */ public const FLAG_FILEATTACH = 1<<4; + /** @var int Message in transit to another destination */ public const FLAG_INTRANSIT = 1<<5; + /** @var int Unknown destination - node not in nodelist */ public const FLAG_ORPHAN = 1<<6; + /** @var int Kill after mailing */ public const FLAG_KILLSENT = 1<<7; + /** @var int Message originated here */ public const FLAG_LOCAL = 1<<8; + /** @var int Hold message here to be collected (Crash + Hold = Direct) */ public const FLAG_HOLD = 1<<9; + /** @var int Reserved for future use by FTS-0001 */ public const FLAG_UNUSED_10 = 1<<10; + /** @var int Requesting a file (filename in subject) */ public const FLAG_FREQ = 1<<11; - public const FLAG_RETRECEIPT = 1<<12; + /** @var int Return Receipt requested */ + public const FLAG_RETRECEIPT = 1<<12; // (RRQ) + /** @var int Return Receipt message in response to an RRQ */ public const FLAG_ISRETRECEIPT = 1<<13; - public const FLAG_AUDITREQ = 1<<14; - public const FLAG_FILEUPDATEREQ = 1<<15; + /** @var int Request audit trail */ + public const FLAG_AUDITREQ = 1<<14; // (ARQ) + /** @var int Requesting a file update (filename in subject) */ + public const FLAG_FILEUPDATEREQ = 1<<15; // (URQ) + /** Echomail has been scanned out */ public const FLAG_ECHOMAIL = 1<<16; // FTS-0001.016 Message header 32 bytes node, net, flags, cost, date diff --git a/app/Classes/FTN/Process/Netmail/Ping.php b/app/Classes/FTN/Process/Netmail/Ping.php index c355efc..d128c69 100644 --- a/app/Classes/FTN/Process/Netmail/Ping.php +++ b/app/Classes/FTN/Process/Netmail/Ping.php @@ -53,7 +53,7 @@ final class Ping extends Process $o->replyid = $msg->msgid; $o->fftn_id = $ftns->id; $o->tftn_id = ($x=$msg->fftn_o) ? $x->id : NULL; - $o->flags = Message::FLAG_LOCAL; + $o->flags = Message::FLAG_LOCAL|Message::FLAG_PRIVATE; $o->cost = 0; $o->msg = static::format_msg($reply,self::$logo); diff --git a/app/Jobs/MessageProcess.php b/app/Jobs/MessageProcess.php index 7b72c9d..f25b7c9 100644 --- a/app/Jobs/MessageProcess.php +++ b/app/Jobs/MessageProcess.php @@ -169,7 +169,7 @@ class MessageProcess implements ShouldQueue $o->tzoffset = $this->msg->date->utcOffset(); $o->cost = 0; - $o->flags = Message::FLAG_LOCAL; + $o->flags = Message::FLAG_LOCAL|Message::FLAG_PRIVATE; $o->fftn_id = ($x=$this->msg->tftn_o) ? $x->id : NULL; $o->tftn_id = ($x=$this->msg->fftn_o) ? $x->id : NULL; diff --git a/app/Notifications/AddressLink.php b/app/Notifications/AddressLink.php index 52fc707..cafbd71 100644 --- a/app/Notifications/AddressLink.php +++ b/app/Notifications/AddressLink.php @@ -68,7 +68,7 @@ class AddressLink extends Notification //implements ShouldQueue $o->fftn_id = $so->match($this->ao->zone)->first()->id; $o->tftn_id = $this->ao->id; - $o->flags = Message::FLAG_LOCAL; + $o->flags = Message::FLAG_LOCAL|Message::FLAG_PRIVATE|Message::FLAG_CRASH; $o->cost = 0; $o->tagline = 'Address Linking...'; diff --git a/app/Notifications/NetmailTest.php b/app/Notifications/NetmailTest.php index 40db812..63eaac6 100644 --- a/app/Notifications/NetmailTest.php +++ b/app/Notifications/NetmailTest.php @@ -65,7 +65,7 @@ class NetmailTest extends Notification //implements ShouldQueue $o->fftn_id = $so->match($this->ao->zone)->first()->id; $o->tftn_id = $this->ao->id; - $o->flags = Message::FLAG_LOCAL; + $o->flags = Message::FLAG_LOCAL|Message::FLAG_PRIVATE; $o->cost = 0; $o->tagline = 'Testing, testing, 1 2 3.';