diff --git a/app/Classes/FTN/Message.php b/app/Classes/FTN/Message.php index b731b82..2524a14 100644 --- a/app/Classes/FTN/Message.php +++ b/app/Classes/FTN/Message.php @@ -425,10 +425,10 @@ class Message extends FTNBase public function __toString(): string { $return = pack(collect(self::header)->pluck(1)->join(''), - $this->ff, - $this->tf, - $this->fn, - $this->tn, + $this->ff, // Originating Node + $this->tf, // Destination Node + $this->fn, // Originating Net + $this->tn, // Destination Net $this->flags&~(self::FLAG_INTRANSIT|self::FLAG_LOCAL), // Turn off our local/intransit bits $this->cost, $this->date->format('d M y H:i:s'), diff --git a/app/Models/Echomail.php b/app/Models/Echomail.php index 30fe653..8d37d39 100644 --- a/app/Models/Echomail.php +++ b/app/Models/Echomail.php @@ -181,13 +181,18 @@ final class Echomail extends Model implements Packet { Log::info(sprintf('%s:+ Bundling [%s]',self::LOGKEY,$this->id)); + $sysaddress = Setup::findOrFail(config('app.id'))->system->match($this->fftn->zone)->first(); + + if (! $sysaddress) + throw new \Exception(sprintf('%s:! We dont have an address in this network? (%s)',self::LOGKEY,$this->fftn->zone->domain->name)); + // @todo Dont bundle mail to nodes that have been disabled, or addresses that have been deleted $o = new Message; $o->header = [ - 'onode' => $this->fftn->node_id, + 'onode' => $sysaddress->node_id, 'dnode' => $ao->node_id, - 'onet' => $this->fftn->host_id, + 'onet' => $sysaddress->host_id, 'dnet' => $ao->host_id, 'flags' => 0, 'cost' => 0, @@ -221,11 +226,6 @@ final class Echomail extends Model implements Packet if ($this->origin) $o->origin = $this->origin; - $sysaddress = Setup::findOrFail(config('app.id'))->system->match($this->fftn->zone)->first(); - - if (! $sysaddress) - throw new \Exception(sprintf('%s:! We dont have an address in this network? (%s)',self::LOGKEY,$this->fftn->zone->domain->name)); - $o->seenby = $this->seenby->push($sysaddress)->unique()->pluck('ftn2d'); // Add our address to the path and seenby