2021-07-15 14:54:23 +00:00
|
|
|
<?php
|
|
|
|
|
2021-09-12 12:14:04 +00:00
|
|
|
namespace App\Classes\FTN\Process\Netmail;
|
2021-07-15 14:54:23 +00:00
|
|
|
|
2023-07-23 07:27:52 +00:00
|
|
|
use Illuminate\Support\Facades\Notification;
|
2021-07-18 12:10:21 +00:00
|
|
|
use Illuminate\Support\Facades\Log;
|
2021-07-15 14:54:23 +00:00
|
|
|
|
2024-05-19 13:28:45 +00:00
|
|
|
use App\Classes\FTN\Process;
|
|
|
|
use App\Models\{Echomail,Netmail};
|
2023-07-23 07:27:52 +00:00
|
|
|
use App\Notifications\Netmails\Ping as PingNotification;
|
2021-07-15 14:54:23 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Process messages to Ping
|
|
|
|
*
|
|
|
|
* @package App\Classes\FTN\Process
|
|
|
|
*/
|
|
|
|
final class Ping extends Process
|
|
|
|
{
|
2021-08-19 06:59:12 +00:00
|
|
|
private const LOGKEY = 'RP-';
|
|
|
|
|
2024-05-19 13:28:45 +00:00
|
|
|
public static function handle(Echomail|Netmail $mo): bool
|
2021-07-15 14:54:23 +00:00
|
|
|
{
|
2024-05-19 13:28:45 +00:00
|
|
|
if (strtolower($mo->to) !== 'ping')
|
2021-07-15 14:54:23 +00:00
|
|
|
return FALSE;
|
|
|
|
|
2024-05-19 13:28:45 +00:00
|
|
|
Log::info(sprintf('%s:- Processing PING message from (%s) [%s]',self::LOGKEY,$mo->from,$mo->fftn->ftn));
|
2021-07-15 14:54:23 +00:00
|
|
|
|
2024-05-19 13:28:45 +00:00
|
|
|
Notification::route('netmail',$mo->fftn)->notify(new PingNotification($mo));
|
2021-07-15 14:54:23 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|