From bb42f418e038b912083d1935790b030d8fbe2135 Mon Sep 17 00:00:00 2001 From: Deon George Date: Sun, 14 Apr 2024 11:03:17 +1000 Subject: [PATCH] Revert part of 9299697, so that our (lowest) address is selected, especially in the case for msgid creation --- app/helpers.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers.php b/app/helpers.php index 825d998..fced2fe 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -107,7 +107,7 @@ function our_address(Domain $do=NULL,Address $ao=NULL): Collection|Address|NULL $filter = $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=$filter->filter(function($item) use ($ao) { return $item->role < $ao->role; })->sortBy('role'))->count()) + if ($ao && config('fido.strict') && ($x=$filter->filter(function($item) use ($ao) { return $item->role <= $ao->role; })->sortBy('role'))->count()) $filter = $x; return $ao ? $filter->last() : ($do ? $filter : $our);