Fix routed netmails being packed for the hub, not the destination. Added some logging for idle netmails/emails

This commit is contained in:
2024-05-26 20:53:59 +10:00
parent 03bfc9dbfc
commit 7e0178d183
9 changed files with 38 additions and 22 deletions

View File

@@ -68,10 +68,8 @@ class AddressIdle implements ShouldQueue
}
// Netmail Alert (to othernet network address)
// Uncommon addresses
$uncommon = $ao->system->addresses->map(fn($item)=>$item->parent())->diff(our_address())->first();
if ($uncommon) {
Notification::route('netmail',$uncommon->withoutRelations())->notify(new NodeDelistedNetmail($ao->withoutRelations()));
if ($ao->system->uncommon()->count()) {
Notification::route('netmail',$ao->system->uncommon()->first()->withoutRelations())->notify(new NodeDelistedNetmail($ao->withoutRelations()));
$contact = TRUE;
}
@@ -91,10 +89,8 @@ class AddressIdle implements ShouldQueue
}
// Netmail Alert (to othernet network address)
// Uncommon addresses
$uncommon = $ao->system->addresses->map(fn($item)=>$item->parent())->diff(our_address())->first();
if ($uncommon) {
Notification::route('netmail',$uncommon->withoutRelations())->notify(new NodeMarkedDownNetmail($ao->withoutRelations()));
if ($ao->system->uncommon()->count()) {
Notification::route('netmail',$ao->system->uncommon()->first()->withoutRelations())->notify(new NodeMarkedDownNetmail($ao->withoutRelations()));
$contact = TRUE;
}
@@ -124,10 +120,8 @@ class AddressIdle implements ShouldQueue
}
// Netmail Alert (to othernet network address)
// Uncommon addresses
$uncommon = $ao->system->addresses->map(fn($item)=>$item->parent())->diff(our_address())->first();
if ($uncommon) {
Notification::route('netmail',$uncommon->withoutRelations())->notify(new NodeMarkedHoldNetmail($ao->withoutRelations()));
if ($ao->system->uncommon()->count()) {
Notification::route('netmail',$ao->system->uncommon()->first()->withoutRelations())->notify(new NodeMarkedHoldNetmail($ao->withoutRelations()));
$contact = TRUE;
}