Fix ping blank messages

This commit is contained in:
Deon George 2021-08-19 16:59:12 +10:00
parent bcf3297fdb
commit 8685c6407a
No known key found for this signature in database
GPG Key ID: 7670E8DC27415254
3 changed files with 8 additions and 4 deletions

View File

@ -6,6 +6,8 @@ use Illuminate\Support\Arr;
abstract class Process
{
private const LOGKEY = 'R--';
protected const MSG_WIDTH = 79;
/**
@ -63,7 +65,7 @@ abstract class Process
for ($c; $c<count($logo);$c++)
$msg .= utf8_decode(Arr::get($logo,$c))."\r";
$msg = utf8_decode(join("\r",static::msg_footer()))."\r";
$msg .= utf8_decode(join("\r",static::msg_footer()))."\r";
return $msg;
}

View File

@ -16,6 +16,8 @@ use App\Models\{Netmail,Setup};
*/
final class Ping extends Process
{
private const LOGKEY = 'RP-';
private static array $logo = [
'ÚÄ¿þÚÄ¿ÚÄ¿',
'³ ³Â³ ³Àij',
@ -27,7 +29,7 @@ final class Ping extends Process
if (strtolower($msg->user_to) !== 'ping')
return FALSE;
Log::info(sprintf('Processing PING message from (%s) [%s]',$msg->user_from,$msg->fftn));
Log::info(sprintf('%s:- Processing PING message from (%s) [%s]',self::LOGKEY,$msg->user_from,$msg->fftn));
$ftns = Setup::findOrFail(config('app.id'))->system->match($msg->fftn_o->zone)->first();
$reply = sprintf("Your ping was received here on %s and it looks like you sent it on %s. If that is correct, then it took %s to get here.\r",

View File

@ -76,10 +76,10 @@ final class Netmail extends Model implements Packet
$o->message = $this->msg;
if ($this->tagline)
$o->message .= $this->tagline;
$o->message .= '...'.$this->tagline;
if ($this->tearline)
$o->tearline .= $this->tearline;
$o->tearline .= '---'.$this->tearline;
// VIA kludge
$via = $this->via ?: collect();