Limit where were respond to test messages

This commit is contained in:
2023-09-12 17:20:09 +10:00
parent 560bc2f8cb
commit 99866458a4
6 changed files with 63 additions and 11 deletions

View File

@@ -21,11 +21,12 @@ final class Test extends Process
public static function handle(Message $msg): bool
{
if ((strtolower($msg->user_to) !== 'all') || ! in_array(strtolower($msg->subject),self::testing))
if (! self::canProcess($msg->echoarea)
|| (strtolower($msg->user_to) !== 'all')
|| (! in_array(strtolower($msg->subject),self::testing)))
return FALSE;
// @todo Need to limit this to areas defined in config.
Log::info(sprintf('%s:- Processing TEST message from (%s) [%s]',self::LOGKEY,$msg->user_from,$msg->fftn));
Log::info(sprintf('%s:- Processing TEST message from (%s) [%s] in [%s]',self::LOGKEY,$msg->user_from,$msg->fftn,$msg->echoarea));
Notification::route('echomail',$msg->echoarea)->notify(new TestNotification($msg));