Implement 2D domain processing - mainly for fidonet

This commit is contained in:
2023-09-10 22:48:12 +10:00
parent ed7dc2ab8b
commit 673c444acd
8 changed files with 148 additions and 25 deletions

View File

@@ -702,19 +702,31 @@ class Message extends FTNBase
$node = (int)$item;
}
$ftn = sprintf('%d:%d/%d',$this->fz,$net&DomainController::NUMBER_MAX,$node&DomainController::NUMBER_MAX);
// @todo This should be enhanced to include the address at the time of the message.
if ($aos->has($ftn))
$ao = $aos->get($ftn);
else
$aos->put($ftn,($ao=(Address::findFTN($ftn))?->id));
// If domain should be flattened, look for node regardless of zone (within the list of zones for the domain)
if ($this->fdomain && $this->fdomain->flatten) {
$ao = Address::findZone($this->fdomain,$net&DomainController::NUMBER_MAX,$node&DomainController::NUMBER_MAX);
if (! $ao) {
$aoid = $ao?->id;
if (! $ao)
$ftn = sprintf('%d:%d/%d',0,$net&DomainController::NUMBER_MAX,$node&DomainController::NUMBER_MAX);
} else {
$ftn = sprintf('%d:%d/%d',$this->fz,$net&DomainController::NUMBER_MAX,$node&DomainController::NUMBER_MAX);
// @todo This should be enhanced to include the address at the time of the message.
if ($aos->has($ftn))
$aoid = $aos->get($ftn);
else
$aos->put($ftn,($aoid=(Address::findFTN($ftn))?->id));
}
if (! $aoid) {
Log::alert(sprintf('%s:! Undefined Node [%s] in %s.',self::LOGKEY,$ftn,$type));
$rogue->push($ftn);
} else {
$nodes->push($ao);
$nodes->push($aoid);
}
}
}