🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #136297

Re: [Dialog] Scripting question

#136297
From: matija
Date: Tue, 28 Oct 2003 07:26
42 lines
2642 bytes
Ernie Ramaker, completely geschtonkenflapped, wrote:
> Now, if I wanted to check which newsgroup the message is sent to, and
> then only add the header if that group is "foo.bar", how would I go
> about doing that?

     program OnBeforeSendingMessage;

     const cNewsgroups = 'Newsgroups: ';
           cGroup = 'foo.bar';
           cDistribution = 'Distribution: world';

     function OnBeforeSendingMessage(var Message: TStringlist; Servername: string; IsEmail: boolean):boolean; 
     var i : integer;
     begin 
       for i := 0 to message.count-1 do
       begin
         if copy(message.strings[i], 1, length(cNewsgroups)) = cNewsgroups then
         begin
           if pos(cGroup, message.strings[i]) > 0 then
           begin
             message.insert (1, cDistribution);
             break;
           end;
         end;
       end;
     end;
     
     begin
     end.  


     of course, this won't work properly if you're posting to a
     group called 'megafoo.bar' :)

     (all possible typos and compile errors are due to the fact that
     i woke up a couple of minutes ago.)


-- 
there is a cheer. the gnomes have learned a new way to say hooray.   [-shpongle]

address is scrambled - remove SPAMISEVIL to reply
Technical Details
Message-ID: <18dwgegphqsju.dlg@shpongle.604>
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!text1.nnrp.aus1!firehose2!nntp4!intern1.nntp.aus1.giganews.com!border3.nntp.aus1.giganews.com!small1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeed.stueberl.de!fu-berlin.de!CARNet.hr!not-for-mail
References: <14njz20cxpwyw$.1x5lgm0w0isr5$.dlg@40tude.net>

Show Full Headers
Complete Article Headers
Message-ID: <18dwgegphqsju.dlg@shpongle.604>
Subject: Re: [Dialog] Scripting question
Date: Tue, 28 Oct 2003 08:26:56 +0100
From: matija <mSkPrAnMic@jaIgSor.srEcVe.IhLr>
References: <14njz20cxpwyw$.1x5lgm0w0isr5$.dlg@40tude.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!text1.nnrp.aus1!firehose2!nntp4!intern1.nntp.aus1.giganews.com!border3.nntp.aus1.giganews.com!small1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeed.stueberl.de!fu-berlin.de!CARNet.hr!not-for-mail
Newsgroups: news.software.readers
Organization: 604
Lines: 42
NNTP-Posting-Host: cmung25.cmu.carnet.hr
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Trace: bagan.srce.hr 1067326014 9716 193.198.128.25 (28 Oct 2003 07:26:54
 GMT)
X-Complaints-To: abuse@carnet.hr
NNTP-Posting-Date: Tue, 28 Oct 2003 07:26:54 +0000 (UTC)
User-Agent: 40tude_Dialog/2.0.7.67hr (9ec61305.431.7)
X-Afraid-Of: spiders
X-Face: "wB!^cgWZ=;
 q%#:6lkzMWJ-O*>}<FSIu#HEqp5P2E#=mTGgQ-\^YM|Vt(j_|:*GI8?,7A9Z
 mkgCj|$f)nB@*>(B14sXotbL/"G.Z0u$]5\GcxnO4')%FUE\48H!!$rCLV.`
X-Mastered: the art of pizza making
X-Searching-For: GMT soundtrack (guy sigsworth)