Correctly storing netmail flags (intransit, local, recv) with senders ID and packet name

This commit is contained in:
2023-07-15 10:46:19 +10:00
parent 7bf957df3a
commit 61ab0614b6
7 changed files with 187 additions and 36 deletions

View File

@@ -191,7 +191,7 @@ class Address extends Model
public function echomails()
{
return $this->belongsToMany(Echomail::class,'echomail_seenby')
->withPivot(['sent_at','export_at','packet']);
->withPivot(['export_at','sent_at','sent_pkt']);
}
public function echomail_from()
@@ -743,6 +743,6 @@ class Address extends Model
*/
public function session(string $type): ?string
{
return ($x=$this->system->sessions->where('id',$this->zone_id)->first()) ? $x->pivot->{$type} : NULL;
return ($this->exists && ($x=$this->system->sessions->where('id',$this->zone_id)->first())) ? $x->pivot->{$type} : NULL;
}
}