Fixes for DE-LIST notifications

This commit is contained in:
2024-09-08 20:39:10 +10:00
parent 9d7455233b
commit 7f95305d75
5 changed files with 13 additions and 9 deletions

View File

@@ -58,7 +58,7 @@ class AbsentNodes extends Echomails
$msg->addText("The following nodes have had their status changed, because they are absent from the network.\r\r");
// Nodes marked HOLD - will be marked down ...
if (($x=$this->aos->filter(fn($item)=>$item->role & Address::NODE_HOLD))->count()) {
if (($x=$this->aos->filter(fn($item)=>$item->active && ($item->role & Address::NODE_HOLD)))->count()) {
$msg->addText("The following nodes have been marked HOLD:\r");
foreach ($x as $ao)
@@ -68,7 +68,7 @@ class AbsentNodes extends Echomails
}
// Nodes marked DOWN - will be delisted on...
if (($x=$this->aos->filter(fn($item)=>$item->role & Address::NODE_DOWN))->count()) {
if (($x=$this->aos->filter(fn($item)=>$item->active && ($item->role & Address::NODE_DOWN)))->count()) {
$msg->addText("The following nodes have been marked DOWN:\r");
foreach ($x as $ao)

View File

@@ -35,9 +35,9 @@ class NodeDelisted extends Netmails //implements ShouldQueue
$o = $this->setupNetmail($notifiable);
$ao = $notifiable->routeNotificationFor(static::via);
Log::info(sprintf('%s:+ Sending a NODE MARKED HOLD for address [%s]',self::LOGKEY,$ao->ftn));
Log::info(sprintf('%s:+ Sending a NODE DE-LISTED for address [%s]',self::LOGKEY,$ao->ftn));
$o->subject = sprintf('Your system has been DE-LISTED from %s',$x=$ao->zone->domain->name);
$o->subject = sprintf('Your system has been DE-LISTED from %s',$x=$this->ao->zone->domain->name);
$o->flags = (Message::FLAG_LOCAL|Message::FLAG_PRIVATE|Message::FLAG_CRASH);
// Message
@@ -46,7 +46,7 @@ class NodeDelisted extends Netmails //implements ShouldQueue
$msg->addText(sprintf("Hi %s,\r\r",$this->ao->system->sysop))
->addText(sprintf("Your system has been marked **DE-LISTED**, because it hasnt polled **%s** with address %s since **%s** (%d days).\r",$this->ao->zone->domain->name,$this->ao->ftn4d,$this->ao->system->last_session->format('Y-m-d'),$this->ao->system->last_session->diffInDays($now)))
->addText("\r")
->addText("If you think this was a mistake, please let me know.\r")
->addText("If you think this was a mistake, please let me know.\r\r")
->addText(sprintf('If you think about returning to %s, then reach out and we can get you back online pretty quickly.',$x));
$o->msg = $msg->render();