Implemented filefix %SCAN/%RESCAN, and some cosmetic cleanup
This commit is contained in:
@@ -25,7 +25,7 @@ final class Filefix extends Robot
|
||||
if ((strtolower($mo->to) !== 'filefix') || (! ($mo instanceof Netmail)))
|
||||
return FALSE;
|
||||
|
||||
Log::info(sprintf('%s:- Processing FILEFIX [%s] message from (%s) [%s]', self::LOGKEY, $mo->to, $mo->from, $mo->fftn->ftn));
|
||||
Log::info(sprintf('%s:- Processing FILEFIX [%s] message from (%s) [%s]',self::LOGKEY,$mo->to,$mo->from,$mo->fftn->ftn));
|
||||
|
||||
return parent::handle($mo);
|
||||
}
|
||||
@@ -36,17 +36,28 @@ final class Filefix extends Robot
|
||||
$result->push('--> BEGIN <--');
|
||||
|
||||
foreach ($mo->body_lines as $command) {
|
||||
Log::debug(sprintf('%s:* Processing command [%s]',self::LOGKEY,$command));
|
||||
|
||||
// Skip empty lines
|
||||
if (! $command)
|
||||
if (! $command || preg_match('/^\s+$/',$command))
|
||||
continue;
|
||||
|
||||
$command = explode(' ',strtoupper(trim($command)));
|
||||
$command = explode(' ',strtoupper(rtrim($command)));
|
||||
Log::debug(sprintf('%s:* Processing command',self::LOGKEY),['command'=>$command]);
|
||||
|
||||
// If command starts with '...' or '---', its a tear/tag line, and we have reached the end
|
||||
if (str_starts_with($command[0],'...') || str_starts_with($command[0],'---')) {
|
||||
Log::debug(sprintf('%s:= We got a tearline/tagline, end of processing',self::LOGKEY));
|
||||
Log::info(sprintf('%s:= We got a tearline/tagline, end of processing',self::LOGKEY));
|
||||
|
||||
$result->push('--> END OF PROCESSING <--');
|
||||
$result->push('--> END OF PROCESSING - TEARLINE/TAGLINE <--');
|
||||
|
||||
break;
|
||||
|
||||
// Lines starting with a space, we'll abort
|
||||
} elseif (! $command[0]) {
|
||||
Log::info(sprintf('%s:= Got a new line with a space, end of processing',self::LOGKEY));
|
||||
|
||||
$result->push('--> END OF PROCESSING - SPACE DETECTED <--');
|
||||
|
||||
break;
|
||||
|
||||
|
Reference in New Issue
Block a user