Remove Address::downstream() for Address::downlinks()

This commit is contained in:
2024-11-25 23:24:21 +11:00
parent 9c828d65e6
commit 1296e3be40
3 changed files with 19 additions and 32 deletions

View File

@@ -1062,20 +1062,6 @@ class Address extends Model
return $children->diff($exclude);
}
/**
* List of all our nodes and their children
*
* @return \Illuminate\Support\Collection
* @throws \Exception
* @deprecated use children()
*/
public function downstream(): \Illuminate\Support\Collection
{
return $this->downlinks()->transform(function($item) {
return $item->nodes()->push($item);
})->flatten();
}
/**
* Files waiting to be sent to this system
*
@@ -1266,8 +1252,8 @@ class Address extends Model
// Addresses that our downstream of this address, except anybody that has session details with us
$ours = our_nodes($this->zone->domain)->pluck('id');
$addresses = $this->downstream()
->filter(fn($item)=>! $ours->contains($item->id))
$addresses = $this->downlinks()
->filter(fn($item)=>(! $ours->contains($item->id)))
->merge($this->system->match($this->zone,Address::NODE_ALL));
$netmails = $this