Add kludge to Test responses

This commit is contained in:
Deon George 2021-09-14 23:14:13 +10:00
parent 2cd6db2060
commit 8b8b513ed1
4 changed files with 14 additions and 1 deletions

View File

@ -190,6 +190,7 @@ class Message extends FTNBase
$this->dst = [];
$this->point = [];
$this->kludge = collect();
$this->rescanned = collect();
$this->path = collect();
$this->seenby = collect();
@ -408,6 +409,7 @@ class Message extends FTNBase
case 'message':
case 'kludge':
case 'tagline':
case 'tearline':
case 'origin':

View File

@ -74,6 +74,7 @@ final class Test extends Process
$o->tagline = 'I ate a clock yesterday, it was very time-consuming.';
$o->tearline = sprintf('%s (%04X)',Setup::PRODUCT_NAME,Setup::PRODUCT_ID);
$o->origin = sprintf('%s (%s)',Setup::PRODUCT_NAME,$ftns->ftn4d);
$o->kludges = collect(['chrs'=>$msg->kludge->get('chrs') ?: 'CP437 2']);
$o->save();
return TRUE;

View File

@ -21,6 +21,8 @@ final class Echomail extends Model implements Packet
protected $collection = FALSE;
protected $casts = [ 'kludges' => 'json' ];
private const cast_utf8 = [
'subject',
'msg',
@ -84,6 +86,11 @@ final class Echomail extends Model implements Packet
/* ATTRIBUTES */
public function getKludgesAttribute(string $value): Collection
{
return collect($this->castAttribute('kludges',$value));
}
public function getPathAttribute(?array $value): Collection
{
if (is_null($value))
@ -136,6 +143,9 @@ final class Echomail extends Model implements Packet
$o->echoarea = $this->echoarea->name;
$o->flags = $this->flags;
if ($this->kludges)
$o->kludge = $this->kludges;
$o->kludge->put('mid',$this->id);
$o->msgid = $this->msgid;

View File

@ -1,7 +1,7 @@
<?php
return [
// Echmail
// Echomail
'echomail' => [
\App\Classes\FTN\Process\Echomail\Test::class,
],