Exported echomail should have the Hub as the OrigNet/OrigNode

This commit is contained in:
Deon George 2023-10-09 21:54:46 +11:00
parent 953d3725b2
commit c8ab8d3db3
2 changed files with 11 additions and 11 deletions

View File

@ -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'),

View File

@ -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