Multiple enhancements to interactive messages, moved messages to Notifications, send netmail back when invalid packet password
This commit is contained in:
49
app/Traits/MessagePath.php
Normal file
49
app/Traits/MessagePath.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Add show the message detail
|
||||
*/
|
||||
namespace App\Traits;
|
||||
|
||||
use App\Classes\FTN\Message;
|
||||
|
||||
trait MessagePath
|
||||
{
|
||||
protected function message_path(Message $mo): string
|
||||
{
|
||||
$reply = "This is your original message:\r\r";
|
||||
|
||||
$reply .= "+--[ BEGIN MESSAGE ]----------------------------------+\r";
|
||||
$reply .= sprintf("TO: %s\r",$mo->user_to);
|
||||
$reply .= sprintf("SUBJECT: %s\r",$mo->subject);
|
||||
$reply .= str_replace("\r---","\r#--",$mo->message)."\r";
|
||||
|
||||
$reply .= "+--[ CONTROL LINES ]----------------------------------+\r";
|
||||
$reply .= sprintf("DATE: %s\r",$mo->date->format('Y-m-d H:i:s'));
|
||||
$reply .= sprintf("MSGID: %s\r",$mo->msgid);
|
||||
|
||||
foreach ($mo->kludge as $k=>$v)
|
||||
$reply .= sprintf("@%s: %s\r",strtoupper($k),$v);
|
||||
|
||||
$reply .= "+--[ PATH ]-------------------------------------------+\r";
|
||||
|
||||
if ($mo->isNetmail()) {
|
||||
if ($mo->via->count())
|
||||
foreach ($mo->via as $via)
|
||||
$reply .= sprintf("VIA: %s\r",$via);
|
||||
else
|
||||
$reply .= "No path information? This would be normal if this message came directly to the hub\r";
|
||||
|
||||
} else {
|
||||
if ($mo->path->count())
|
||||
foreach ($mo->path as $via)
|
||||
$reply .= sprintf("VIA: %s\r",$via);
|
||||
else
|
||||
$reply .= "No path information? This would be normal if this message came directly to the hub\r";
|
||||
}
|
||||
|
||||
$reply .= "+--[ END MESSAGE ]------------------------------------+\r";
|
||||
|
||||
return $reply;
|
||||
}
|
||||
}
|
31
app/Traits/PageTemplate.php
Normal file
31
app/Traits/PageTemplate.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Template for starting a message
|
||||
*/
|
||||
namespace App\Traits;
|
||||
|
||||
use App\Classes\{ANSI,Page};
|
||||
use App\Classes\Fonts\{Thick,Thin};
|
||||
|
||||
trait PageTemplate
|
||||
{
|
||||
protected function page(bool $addlogo=FALSE,string $leftbox=''): Page
|
||||
{
|
||||
$page = new Page;
|
||||
if ($addlogo)
|
||||
$page->addLogo(new ANSI('public/logo/netmail.bin'));
|
||||
|
||||
$header = new Thick;
|
||||
$header->addText('Clearing Houz');
|
||||
$page->addHeader($header,'FTN Mailer and Tosser',TRUE,0xc4);
|
||||
|
||||
if ($leftbox) {
|
||||
$lbc = new Thin;
|
||||
$lbc->addText($leftbox);
|
||||
$page->addLeftBoxContent($lbc);
|
||||
}
|
||||
|
||||
return $page;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user