🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #217163

Re: [Dialog] I need two X-No-Archive Headers

#217163
From: MikeV06
Date: Fri, 22 Feb 2008 17:19
116 lines
4060 bytes
On Thu, 21 Feb 2008 22:49:22 -0500, Gember Breuk wrote:
 
> Here is the script that makes it work:
> 
> Set the 'XNA: yes' header as usual. Compile and save the script to add
> the 'XNA: banter' header next after the U-A.
> 
> -----------------------[copy below]---------------------------
> 
> program OnBeforeSendingMessage;
> 
> const
>     ChangeHeader = 'User-Agent';
>     AddHeader = 'X-No-Archive: banter';
>         
> procedure ChangeAnyHeader(Message:TStringlist;IsEmail:boolean);
> var i:integer;
>     s:string;
> 
> begin
>     s := Message.text;
>     i := 1;
>        
>     while (Message.Strings[i]<>'') do
>     begin
>       if pos(ChangeHeader,Message.Strings[i])<>0 then
>       begin
>        Message.Strings[i+1] := AddHeader;
>        s := Message.text;
>       end;
>       i := i + 1;
>     end; {end of while}
>     message.text := s;
> end;
> 
> //The next line should not wrap from 'function' to 'boolean):Boolean;'
> 
> function OnBeforeSendingMessage(var Message: TStringlist; Servername:
> string; IsEmail: boolean):Boolean;
> 
> begin
>   ChangeAnyHeader(Message,IsEmail);
>   result:=true;
> end;
> 
> begin
> end.
> 
> -----------------------[copy above]---------------------------
Nice script!

What is the best way to combine (insert, whatever) your script with an
existing script for the OnBeforeSendingMessage event?

Obviously, one would not duplicate the program heading since the existing
script already has one.

program OnBeforeSendingMessage;

//script to automagically insert Boxquotes into a message before being sent
//you will not see the result inside the editor-window but only in the
transmitted article
//box: or box_o:
//Example
//-
//aslkdjl aksdj lkajsd lkjalsdkj lakj sadalksjd lkjasldkj lakjd
//- 

One most likely can just add the const and procedure at the bottom of the
existing script before the terminating clauses.

begin
end.

What I am not quite clear on is how to handle your function with the
existing driving function:

function OnBeforeSendingMessage(
   var   Message    : TStringlist;
   const Servername : String;
   const IsEmail    : Boolean
) : Boolean;

begin
   //
   // if result is set to false, sending messages will *always* fail;
   // use this for debugging along with the messagebox.
   //
   result := true;
   if Message.count < 500 then BoxQuote( Message );
end;  // function OnBeforeSendingMessage()

Your function call is the same as the existing one, so no problem there:

> function OnBeforeSendingMessage(
>     var Message: TStringlist; 
>      Servername: string;
>         IsEmail: boolean
> ):Boolean;

How do I incorporate this part with the existing part?

> begin
>   ChangeAnyHeader(Message,IsEmail);
>   result:=true;
> end;

BTW, what is the difference between the default header Archive: (yes/no)
and X-No-Archive: (yes/no)?

Thank you for taking the time to write the script. 

Mike


 
Technical Details
Message-ID: <w197mn7o9vd6$.dlg@mycomputer06.invalid>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!post01.iad01!news.suddenlink.net!not-for-mail
References: <40lhz7pt2tqo.dlg@sqwertz.com> <1td7qgn0qa5kx$.dlg@blackholespam.net> <1l5i97dcyjakx$.dlg@sqwertz.com> <1cfxfs0ud4v2i.dlg@blackholespam.net>

Show Full Headers
Complete Article Headers
Message-ID: <w197mn7o9vd6$.dlg@mycomputer06.invalid>
Subject: Re: [Dialog] I need two X-No-Archive Headers
Date: Fri, 22 Feb 2008 11:19:38 -0600
From: MikeV06 <me@mycomputer06.invalid>
References: <40lhz7pt2tqo.dlg@sqwertz.com> <1td7qgn0qa5kx$.dlg@blackholespam.net> <1l5i97dcyjakx$.dlg@sqwertz.com> <1cfxfs0ud4v2i.dlg@blackholespam.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!post01.iad01!news.suddenlink.net!not-for-mail
Newsgroups: news.software.readers
User-Agent: 40tude_Dialog/2.0.15.41
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Organization: None
Archive: No
X-No-Archive: Yes
Lines: 116
NNTP-Posting-Host: 74.194.81.60
X-Complaints-To: abuse@suddenlink.net