Respond to areafix netmails
This commit is contained in:
36
app/Classes/FTN/Process/Netmail/Areafix.php
Normal file
36
app/Classes/FTN/Process/Netmail/Areafix.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\FTN\Process\Netmail;
|
||||
|
||||
use Illuminate\Support\Facades\Notification;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
use App\Classes\FTN\{Message,Process};
|
||||
use App\Notifications\Netmails\Areafix as AreafixNotification;
|
||||
use App\Notifications\Netmails\Areafix\NotConfiguredHere as AreafixNotConfiguredHereNotification;
|
||||
|
||||
/**
|
||||
* Process messages to Ping
|
||||
*
|
||||
* @package App\Classes\FTN\Process
|
||||
*/
|
||||
final class Areafix extends Process
|
||||
{
|
||||
private const LOGKEY = 'RP-';
|
||||
|
||||
public static function handle(Message $msg): bool
|
||||
{
|
||||
if (strtolower($msg->user_to) !== 'areafix')
|
||||
return FALSE;
|
||||
|
||||
Log::info(sprintf('%s:- Processing AREAFIX message from (%s) [%s]',self::LOGKEY,$msg->user_from,$msg->fftn));
|
||||
|
||||
// If this is not a node we manage, then respond with a sorry can help you
|
||||
if ($msg->fftn_o->system->sessions->count())
|
||||
Notification::route('netmail',$msg->fftn_o)->notify(new AreafixNotification($msg));
|
||||
else
|
||||
Notification::route('netmail',$msg->fftn_o)->notify(new AreafixNotConfiguredHereNotification($msg));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user