Dont enable rogue_path - it looses our true path for messages - instead create addresses in the path we dont know about.

This commit is contained in:
2023-09-15 16:59:46 +10:00
parent 6e133770fc
commit c1d6d48a3c
4 changed files with 38 additions and 19 deletions

View File

@@ -684,11 +684,6 @@ class Message extends FTNBase
*/
private function parseAddresses(string $type,Collection $addresses,Collection &$rogue): Collection
{
static $aos = NULL;
if (! $aos)
$aos = collect();
$nodes = collect();
$net = NULL;
@@ -706,23 +701,37 @@ class Message extends FTNBase
if ($this->fdomain && $this->fdomain->flatten) {
$ao = Address::findZone($this->fdomain,$net&DomainController::NUMBER_MAX,$node&DomainController::NUMBER_MAX,0);
$ftn = sprintf('%d:%d/%d@%s',0,$net&DomainController::NUMBER_MAX,$node&DomainController::NUMBER_MAX,$this->fdomain->name);
$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);
$aoid = NULL;
}
// @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));
switch ($type) {
case 'path':
if (! $aoid) {
$ao = (Address::findFTN($ftn,TRUE));
$aoid = $ao?->id;
}
break;
case 'seenby':
if (! $aoid) {
$ao = (Address::findFTN($ftn));
$aoid = $ao?->id;
}
break;
default:
throw new \Exception('Unknown type: '.$type);
}
if (! $aoid) {
Log::alert(sprintf('%s:! Undefined Node [%s] in %s.',self::LOGKEY,$ftn,$type));
Log::alert(sprintf('%s:! Undefined Node [%s] in [%s].',self::LOGKEY,$ftn,$type));
$rogue->push($ftn);
} else {