Enable processing messages coming from a domain with multiple zones

This commit is contained in:
Deon George
2023-01-02 01:05:44 +11:00
parent c1ab14f2e6
commit 109beb4f4f
2 changed files with 7 additions and 22 deletions

View File

@@ -222,7 +222,7 @@ class Message extends FTNBase
case 'fdomain':
// We'll use the zone's domain if this method class was called with a zone
if ($this->zone && ($this->zone->domain->name == Arr::get($this->src,'d')))
if ($this->zone && (($this->zone->domain->name == Arr::get($this->src,'d')) || ! Arr::get($this->src,'d')))
return $this->zone->domain;
// If we get the domain from the packet, we'll find it
@@ -234,7 +234,7 @@ class Message extends FTNBase
case 'tdomain':
// We'll use the zone's domain if this method class was called with a zone
if ($this->zone && ($this->zone->domain->name == Arr::get($this->dst,'d')))
if ($this->zone && (($this->zone->domain->name == Arr::get($this->dst,'d')) || ! Arr::get($this->dst,'d')))
return $this->zone->domain;
// If we get the domain from the packet, we'll find it
@@ -250,7 +250,6 @@ class Message extends FTNBase
if ($this->zone && ($this->fz == $this->zone->zone_id))
return $this->zone;
// If we have a domain, we'll use the zone from the domain
if ($this->fdomain) {
if (($x=$this->fdomain->zones->search(function($item) { return $item->zone_id == $this->fz; })) !== FALSE)
return $this->fdomain->zones->get($x);
@@ -266,7 +265,6 @@ class Message extends FTNBase
if ($this->zone && ($this->tz == $this->zone->zone_id))
return $this->zone;
// If we have a domain, we'll use the zone from the domain
if ($this->tdomain) {
if (($x=$this->tdomain->zones->search(function($item) { return $item->zone_id == $this->tz; })) !== FALSE)
return $this->tdomain->zones->get($x);
@@ -290,10 +288,11 @@ class Message extends FTNBase
case 'tftn_o':
return parent::__get($key);
// For 5D we need to include the domain
case 'fboss':
return sprintf('%d:%d/%d',$this->fz,$this->fn,$this->ff);
return sprintf('%d:%d/%d',$this->fz,$this->fn,$this->ff).(($x=$this->fdomain) ? '@'.$x->name : '');
case 'tboss':
return sprintf('%d:%d/%d',$this->tz,$this->tn,$this->tf);
return sprintf('%d:%d/%d',$this->tz,$this->tn,$this->tf).(($x=$this->tdomain) ? '@'.$x->name : '');
case 'fboss_o':
return Address::findFTN($this->fboss);
case 'tboss_o':