BINKP responding to incoming netmail pings

This commit is contained in:
Deon George
2021-07-18 22:10:21 +10:00
parent 7bb3e12f66
commit 9dcfe6b17d
19 changed files with 145 additions and 54 deletions

View File

@@ -12,8 +12,20 @@ class Netmail extends Model
{
use SoftDeletes;
protected $connection = 'mongodb';
protected $dates = ['datetime'];
//protected $connection = 'mongodb';
protected $dates = ['datetime','sent_at'];
/**
* Resolve a connection instance.
* We need to do this, because our relations are in pgsql and somehow loading a relation changes this models
* connection information. Using protected $connection is not enough.
*
* @param string|null $connection
*/
public static function resolveConnection($connection = null)
{
return static::$resolver->connection('mongodb');
}
/* RELATIONS */
@@ -69,6 +81,10 @@ class Netmail extends Model
$o->user_from = $this->from;
$o->subject = $this->subject;
$o->message = $this->msg;
if ($this->tagline)
$o->message .= "\r... ".$this->tagline."\r";
$o->tearline .= $this->tearline;
$o->msgid = sprintf('%s %08x',$this->fftn->ftn3d,crc32($this->id));