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

@@ -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;