Create TO ftn (for netmails), identify REPLYID, add file:list
This commit is contained in:
@@ -45,7 +45,6 @@ class Message extends FTNBase
|
||||
'codepage' => 'CODEPAGE: ',
|
||||
'dbid' => 'DBID: ',
|
||||
'pid' => 'PID: ',
|
||||
'replyid' => 'REPLY: ',
|
||||
'tid' => 'TID: ',
|
||||
];
|
||||
|
||||
@@ -176,7 +175,6 @@ class Message extends FTNBase
|
||||
$this->zone = $zone;
|
||||
|
||||
$this->header = [];
|
||||
$this->kludge = collect();
|
||||
|
||||
$this->user_from = '';
|
||||
$this->user_to = '';
|
||||
@@ -234,6 +232,19 @@ class Message extends FTNBase
|
||||
|
||||
return NULL;
|
||||
|
||||
case 'tdomain':
|
||||
// We'll use the zone's domain if this method class was called with a zone
|
||||
if ($this->zone && ($this->zone->domain->name == Arr::get($this->dst,'d')))
|
||||
return $this->zone->domain;
|
||||
|
||||
// If we get the domain from the packet, we'll find it
|
||||
if ($x=Arr::get($this->dst,'d')) {
|
||||
return Domain::where('name',$x)->single();
|
||||
}
|
||||
|
||||
// Otherwise we'll assume the same as the source domain
|
||||
return $this->fdomain ?: NULL;
|
||||
|
||||
case 'fzone':
|
||||
// Use the zone if this class was called with it.
|
||||
if ($this->zone && ($this->fz == $this->zone->zone_id))
|
||||
@@ -250,12 +261,28 @@ class Message extends FTNBase
|
||||
->where('default',TRUE)
|
||||
->single();
|
||||
|
||||
case 'tzone':
|
||||
// Use the zone if this class was called with it.
|
||||
if ($this->zone && ($this->tz == $this->zone->zone_id))
|
||||
return $this->zone;
|
||||
|
||||
// If we have a domain, we'll use the zone from the domain
|
||||
if ($x=$this->tdomain) {
|
||||
if (($x=$this->tdomain->zones->search(function($item) { return $item->zone_id == $this->tz; })) !== FALSE)
|
||||
return $this->tdomain->zones->get($x);
|
||||
}
|
||||
|
||||
// No domain, so we'll use the default zone
|
||||
return Zone::where('zone_id',$this->tz)
|
||||
->where('default',TRUE)
|
||||
->single();
|
||||
|
||||
// To Addresses
|
||||
// Echomail doesnt have a zone, so we'll use the source zone
|
||||
case 'tz': return Arr::get($this->echoarea ? $this->src : $this->dst,'z');
|
||||
case 'tn': return Arr::get($this->header,'dnet');
|
||||
case 'tf': return Arr::get($this->header,'dnode');
|
||||
case 'tp': return Arr::get($this->dst,'p'); // @todo this wont work for netmails, since dst is not set for in transit messages
|
||||
case 'tp': ;return Arr::get($this->dst,'p',0); // @todo this wont work for netmails, since dst is not set for in transit messages
|
||||
|
||||
case 'fftn':
|
||||
case 'fftn_o':
|
||||
@@ -818,6 +845,9 @@ class Message extends FTNBase
|
||||
elseif ($t = $this->kludge('MSGID: ',$kl))
|
||||
$this->msgid = $t;
|
||||
|
||||
elseif ($t = $this->kludge('REPLY: ',$kl))
|
||||
$this->replyid = $t;
|
||||
|
||||
elseif ($t = $this->kludge('GATE: ',$kl))
|
||||
$this->gateid = $t;
|
||||
|
||||
|
@@ -450,12 +450,12 @@ class Packet extends FTNBase implements \Iterator, \Countable
|
||||
Address::reguard();
|
||||
|
||||
} catch (\Exception $e) {
|
||||
Log::error(sprintf('%s:! Error finding/creating address [%s] for message',self::LOGKEY,$msg->tboss));
|
||||
Log::error(sprintf('%s:! Error finding/creating TO address [%s] for message',self::LOGKEY,$msg->tboss),['error'=>$e->getMessage()]);
|
||||
}
|
||||
|
||||
// This shouldnt happen
|
||||
if ($e || $ao->exists) {
|
||||
Log::error(sprintf('%s:! Unexpected error attempting to create address [%s]',self::LOGKEY,$msg->tboss));
|
||||
Log::error(sprintf('%s:! Unexpected error attempting to create TO address [%s]',self::LOGKEY,$msg->tboss));
|
||||
$this->errors->push($msg);
|
||||
return;
|
||||
}
|
||||
@@ -492,12 +492,12 @@ class Packet extends FTNBase implements \Iterator, \Countable
|
||||
Address::reguard();
|
||||
|
||||
} catch (\Exception $e) {
|
||||
Log::error(sprintf('%s:! Error finding/creating address [%s] for message',self::LOGKEY,$msg->fboss));
|
||||
Log::error(sprintf('%s:! Error finding/creating FROM address [%s] for message',self::LOGKEY,$msg->fboss),['error'=>$e->getMessage()]);
|
||||
}
|
||||
|
||||
// This shouldnt happen
|
||||
if ($e || $ao->exists) {
|
||||
Log::error(sprintf('%s:! Unexpected error attempting to create address [%s]',self::LOGKEY,$msg->fboss));
|
||||
Log::error(sprintf('%s:! Unexpected error attempting to create FROM address [%s]',self::LOGKEY,$msg->fboss));
|
||||
$this->errors->push($msg);
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user