Added SEEN-BY/PATH processing, dont show networks that are not public, minor other formatting

This commit is contained in:
Deon George
2021-08-19 23:35:48 +10:00
parent ad21285a8c
commit 9f762a642c
6 changed files with 98 additions and 31 deletions

View File

@@ -161,14 +161,6 @@ class ProcessPacket implements ShouldQueue
// Else we are echomail
} else {
Log::info(sprintf('%s: - Echomail [%s] in [%s] from (%s) [%s] to (%s).',
self::LOGKEY,
$this->msg->msgid,
$this->msg->echoarea,
$this->msg->user_to,$this->msg->tftn,
$this->msg->user_from,
));
$ea = Echoarea::where('name',$this->msg->echoarea)
->where('domain_id',$this->msg->fftn_o->zone->domain_id)
->single();
@@ -191,6 +183,7 @@ class ProcessPacket implements ShouldQueue
}
// @todo Can the sender create it if it doesnt exist?
// @todo Can the sender send messages to this area?
// - Create it, or
// - Else record in bad area
@@ -207,11 +200,23 @@ class ProcessPacket implements ShouldQueue
$o->msgid = $this->msg->msgid;
$o->msg = $this->msg->message_src;
// @todo Record Path
// @todo Record SeenBy
$o->path = $this->msg->pathaddress->pluck('id')->jsonSerialize();
$o->rogue_path = $this->msg->rogue_path->jsonSerialize();
$o->seenby = $this->msg->seenaddress->pluck('id')->jsonSerialize();
$o->rogue_seen = $this->msg->rogue_path->jsonSerialize();
$o->toexport = TRUE;
$o->save();
Log::info(sprintf('%s: - Echomail [%s] in [%s] from (%s) [%s] to (%s) - [%s].',
self::LOGKEY,
$this->msg->msgid,
$this->msg->echoarea,
$this->msg->user_to,$this->msg->tftn,
$this->msg->user_from,
$o->id,
));
// If the message is to a bot, we'll process it
foreach (config('process.echomail') as $class) {
if ($class::handle($this->msg)) {