2021-07-15 14:54:23 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Classes\FTN;
|
|
|
|
|
2023-09-12 07:20:09 +00:00
|
|
|
use App\Models\Echoarea;
|
|
|
|
|
2023-06-22 07:36:22 +00:00
|
|
|
/**
|
|
|
|
* Abstract class to hold the common functions for automatic responding to echomail/netmail messages
|
|
|
|
*/
|
2021-07-15 14:54:23 +00:00
|
|
|
abstract class Process
|
|
|
|
{
|
2023-09-12 07:20:09 +00:00
|
|
|
public static function canProcess(string $echoarea): bool
|
|
|
|
{
|
|
|
|
$eao = Echoarea::where('name',$echoarea)->single();
|
|
|
|
|
|
|
|
return $eao && $eao->automsgs;
|
|
|
|
}
|
|
|
|
|
2021-07-15 14:54:23 +00:00
|
|
|
/**
|
|
|
|
* Return TRUE if the process class handled the message.
|
|
|
|
*
|
|
|
|
* @param Message $msg
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
abstract public static function handle(Message $msg): bool;
|
|
|
|
}
|