Further enhancement with #9063a2a - to ensure our message addressing and content picks the right address
This commit is contained in:
@@ -91,15 +91,13 @@ if (! function_exists('hexstr')) {
|
||||
*/
|
||||
function our_address(Domain $do=NULL,Address $ao=NULL): Collection|Address|NULL
|
||||
{
|
||||
$our = Setup::findOrFail(config('app.id'))
|
||||
->system
|
||||
->akas;
|
||||
$our = Setup::findOrFail(config('app.id'))->system->akas;
|
||||
|
||||
if ($do)
|
||||
$our = $our->filter(function($item) use ($do) { return $item->zone->domain_id === $do->id; });
|
||||
$our = $our->filter(function($item) use ($do) { return $item->zone->domain_id === $do->id; })->sortBy('role');
|
||||
|
||||
// If we are looking for a specific address, and there is only 1 result, return it, otherwise return what we have
|
||||
if ($ao && config('fido.strict') && ($x=$our->filter(function($item) use ($ao) { return $item->role <= $ao->role; }))->count())
|
||||
if ($ao && config('fido.strict') && ($x=$our->filter(function($item) use ($ao) { return $item->role <= $ao->role; })->sortBy('role'))->count())
|
||||
$our = $x;
|
||||
|
||||
return $ao ? $our->last() : $our;
|
||||
|
Reference in New Issue
Block a user