EMSI Continue sending mail until no more mail to send
This commit is contained in:
@@ -226,15 +226,19 @@ final class Send extends Item
|
||||
* Add our mail to the send queue
|
||||
*
|
||||
* @param Address $ao
|
||||
* @return bool
|
||||
* @throws Exception
|
||||
* @todo We need to make this into a transaction, incase the transfer fails.
|
||||
*/
|
||||
public function mail(Address $ao): void
|
||||
public function mail(Address $ao): bool
|
||||
{
|
||||
$mail = FALSE;
|
||||
|
||||
// If the node is marked as hold - dont send any mail.
|
||||
if ($ao->system->hold) {
|
||||
Log::info(sprintf('%s: - System [%d] mail is marked as hold - not checking for mail.',self::LOGKEY,$ao->system_id));
|
||||
return;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Netmail
|
||||
@@ -242,6 +246,7 @@ final class Send extends Item
|
||||
Log::debug(sprintf('%s: - Netmail(s) added for sending to [%s]',self::LOGKEY,$ao->ftn));
|
||||
|
||||
$this->packets->push(new Mail($x,self::I_SEND));
|
||||
$mail = TRUE;
|
||||
}
|
||||
|
||||
// Echomail
|
||||
@@ -249,7 +254,10 @@ final class Send extends Item
|
||||
Log::debug(sprintf('%s: - Echomail(s) added for sending to [%s]',self::LOGKEY,$ao->ftn));
|
||||
|
||||
$this->packets->push(new Mail($x,self::I_SEND));
|
||||
$mail = TRUE;
|
||||
}
|
||||
|
||||
return $mail;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user