Multiple enhancements to interactive messages, moved messages to Notifications, send netmail back when invalid packet password

This commit is contained in:
2023-07-23 17:27:52 +10:00
parent 9f0fa0a8ec
commit 17fe7e910d
28 changed files with 837 additions and 475 deletions

View File

@@ -3,9 +3,8 @@
namespace App\Classes\File;
use Illuminate\Support\Arr;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Facades\Notification;
use Symfony\Component\HttpFoundation\File\Exception\FileException;
use App\Classes\{File,Protocol};
@@ -13,6 +12,7 @@ use App\Classes\FTN\{InvalidPacketException,Packet};
use App\Exceptions\FileGrewException;
use App\Jobs\{MessageProcess,TicProcess};
use App\Models\Address;
use App\Notifications\Netmails\PacketPasswordInvalid;
/**
* Object representing the files we are receiving
@@ -138,10 +138,10 @@ class Receive extends Base
}
// Check the packet password
if ($this->ao->session('pktpass') != $po->password) {
if ($this->ao->session('pktpass') !== $po->password) {
Log::error(sprintf('%s:! Packet from [%s] with password [%s] is invalid.',self::LOGKEY,$this->ao->ftn,$po->password));
// @todo Generate message to system advising invalid password - that message should be sent without a packet password!
Notification::route('netmail',$this->ao)->notify(new PacketPasswordInvalid($po->password,$this->receiving->nameas));
break;
}
@@ -158,6 +158,20 @@ class Receive extends Base
// @todo Quick check that the packet should be processed by us.
// @todo validate that the packet's zone is in the domain.
/*
* // @todo generate exception when echomail for an area that doesnt exist
* // @todo generate exception when echomail for an area sender cannot post to
* // @todo generate exception when echomail for an area sender not subscribed to
* // @todo generate exception when echomail comes from a system not defined here
* // @todo generate exception when echomail comes from a system doesnt exist
*
* // @todo generate exception when netmail to system that doesnt exist (node/point)
* // @todo generate exception when netmail from system that doesnt exist (node/point)
* // @todo generate warning when netmail comes from a system not defined here
*
* // @todo generate exception when packet has wrong password
*/
try {
// Dispatch job.
if ($queue)