clrghouz/app/Classes/FTN/Process/Netmail/Ping.php

32 lines
722 B
PHP
Raw Normal View History

<?php
namespace App\Classes\FTN\Process\Netmail;
use Illuminate\Support\Facades\Notification;
use Illuminate\Support\Facades\Log;
use App\Classes\FTN\Process;
use App\Models\{Echomail,Netmail};
use App\Notifications\Netmails\Ping as PingNotification;
/**
* 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-';
public static function handle(Echomail|Netmail $mo): bool
{
if (strtolower($mo->to) !== 'ping')
return FALSE;
Log::info(sprintf('%s:- Processing PING message from (%s) [%s]',self::LOGKEY,$mo->from,$mo->fftn->ftn));
Notification::route('netmail',$mo->fftn)->notify(new PingNotification($mo));
return TRUE;
}
}