🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
7 messages
7 total messages Started by Sqwertz Fri, 29 Feb 2008 21:44
[Dialog] Help with Scripting
#217330
Author: Sqwertz
Date: Fri, 29 Feb 2008 21:44
63 lines
3430 bytes
I'm still trying to figure out why this simple script wants to change 
my existing "X-No-Archive: Yes" into "X-No-archive: banter", 
and  then add another one at the end.  It should add the one at 
the one at the end, but not change by existing 'XNA: Yes' header.

program OnBeforeSendingMessage;

procedure AddAnyHeader(AddHeader:String; var Message:TStringlist;
IsEmail:Boolean);

var i: integer;
begin
   If not IsEmail then begin
      i := 1;
      while Message[i] <> '' do 
            i := i + 1;
      Message.insert(i, AddHeader);
   end
end;

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

begin 
  AddAnyHeader ('X-No-Archive: banter', Message, IsEmail); 
  result := true;
end;

//
----------------------------------------------------------------------

begin
end.

This script produces headers like:

User-Agent: 40tude_Dialog/2.0.15.41
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Message-ID: <e2clhya4o2ne.dlg@sqwertz.com>
X-No-Archive: banter
X-WebTV-Stationery: Standard; BGColor=red; <wrapped>
Background="http://i26.tinypic.com/25polj9.gif"; TextColor=red
X-No-Archive: banter
Lines: 19
NNTP-Posting-Host: 75.55.119.163
X-Complaints-To: abuse@prodigy.net
etc...

As you can see from my current headers, Dialog inserts the XNA header
from the option in my "Identities" setup options, along with my other
custom X-Header (X-WebTV-Stationery), and then script comes along and
appends another XNA header at the bottom, just before my news-server's
headers are stamped on there.

But why does it change the first XNA from "yes" into "banter"?  I have
removed the XNA custom header and redefined it under X-Headers and
Identities, but it still shows up as "banter" instead of "yes" and I
can only assume that this script is changing it.

-sw
Re: [Dialog] Help with Scripting
#217336
Author: Rom
Date: Sat, 01 Mar 2008 03:13
38 lines
2735 bytes
On Fri, 29 Feb 2008 21:44:49 GMT, Sqwertz wrote:

> I'm still trying to figure out why this simple script wants to change 
> my existing "X-No-Archive: Yes" into "X-No-archive: banter", 
> and  then add another one at the end.  It should add the one at 
> the one at the end, but not change by existing 'XNA: Yes' header.
[Script]
> This script produces headers like:
...
> X-No-Archive: banter
> X-WebTV-Stationery: Standard; BGColor=red; <wrapped>
> Background="http://i26.tinypic.com/25polj9.gif"; TextColor=red
> X-No-Archive: banter
...
> 
> As you can see from my current headers, Dialog inserts the XNA header
> from the option in my "Identities" setup options, along with my other
> custom X-Header (X-WebTV-Stationery), and then script comes along and
> appends another XNA header at the bottom, just before my news-server's
> headers are stamped on there.
> 
> But why does it change the first XNA from "yes" into "banter"?  I have
> removed the XNA custom header and redefined it under X-Headers and
> Identities, but it still shows up as "banter" instead of "yes" and I
> can only assume that this script is changing it.

I've added the following X-Header to my usual:
X-WebTV-Stationery: Standard; BGColor=red; Background="http://i26.tinypic.com/25polj9.gif"; TextColor=red

The 'OnBeforeSendingMessage' script I use has been deleted and now
only have the script you posted, which tested fine using Hamster, so
I'll see how it goes posting normally.

While composing, on the All headers tab, if you select X-No-Archive
from X-Headers the drop-down list, does it show yes?

-- 
Rom
Re: [Dialog] Help with Scripting
#217335
Author: Rom
Date: Sat, 01 Mar 2008 04:50
29 lines
2252 bytes
On Sat, 1 Mar 2008 14:13:11 +1100, Rom wrote:

> On Fri, 29 Feb 2008 21:44:49 GMT, Sqwertz wrote:
[...]
>> But why does it change the first XNA from "yes" into "banter"?  I have
>> removed the XNA custom header and redefined it under X-Headers and
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> Identities, but it still shows up as "banter" instead of "yes" and I
>> can only assume that this script is changing it.
> 
> I've added the following X-Header to my usual:
> X-WebTV-Stationery: Standard; BGColor=red; Background="http://i26.tinypic.com/25polj9.gif"; TextColor=red
> 
> The 'OnBeforeSendingMessage' script I use has been deleted and now
> only have the script you posted, which tested fine using Hamster, so
> I'll see how it goes posting normally.

As you can see from my previous message the script you posted worked
fine, and the X-No-Archive and Archive headers are in the identity.

> While composing, on the All headers tab, if you select X-No-Archive
> from X-Headers the drop-down list, does it show yes?

Also recheck, recompile and reload all scripts, because if
"X-No-Archive: yes" shows on the All Headers tab while composing,
perhaps a previous/another script is interfering.

-- 
Rom
Re: [Dialog] Help with Scripting
#217337
Author: Sqwertz
Date: Sat, 01 Mar 2008 04:53
57 lines
3926 bytes
On Sat, 1 Mar 2008 14:13:11 +1100, Rom wrote:

> On Fri, 29 Feb 2008 21:44:49 GMT, Sqwertz wrote:
> 
>> I'm still trying to figure out why this simple script wants to change 
>> my existing "X-No-Archive: Yes" into "X-No-archive: banter", 
>> and  then add another one at the end.  It should add the one at 
>> the one at the end, but not change by existing 'XNA: Yes' header.
> [Script]
>> This script produces headers like:
> ...
>> X-No-Archive: banter
>> X-WebTV-Stationery: Standard; BGColor=red; <wrapped>
>> Background="http://i26.tinypic.com/25polj9.gif"; TextColor=red
>> X-No-Archive: banter
> ...
>> 
>> As you can see from my current headers, Dialog inserts the XNA header
>> from the option in my "Identities" setup options, along with my other
>> custom X-Header (X-WebTV-Stationery), and then script comes along and
>> appends another XNA header at the bottom, just before my news-server's
>> headers are stamped on there.
>> 
>> But why does it change the first XNA from "yes" into "banter"?  I have
>> removed the XNA custom header and redefined it under X-Headers and
>> Identities, but it still shows up as "banter" instead of "yes" and I
>> can only assume that this script is changing it.
> 
> I've added the following X-Header to my usual:
> X-WebTV-Stationery: Standard; BGColor=red; Background="http://i26.tinypic.com/25polj9.gif"; TextColor=red

I'd really like a better picture, that was just the first one I
saw when I was testing it.  And it work fine judging from the
negative feedback I've received from WebTV users :-)

> The 'OnBeforeSendingMessage' script I use has been deleted and now
> only have the script you posted, which tested fine using Hamster, so
> I'll see how it goes posting normally.

Yours looks fine <grumble>.

> While composing, on the All headers tab, if you select X-No-Archive
> from X-Headers the drop-down list, does it show yes?

Yep.  I'll change it to "no" here just for kicks.

It *used to* say "banter" in my X-Headers settings, but I changed
it back to "yes".  

I even did a full text search for the word "banter" (using
Windows Explorer "Search" util) in my ./40tuee directory and it
doesn't find banter.  Not even in my Scripts directory for some
reason.  Weird.

Now this is pissing me off.

-sw
Re: [Dialog] Help with Scripting
#217339
Author: Sqwertz
Date: Sat, 01 Mar 2008 06:54
93 lines
5785 bytes
On Sat, 01 Mar 2008 04:53:05 GMT, Sqwertz wrote:

> Path: newsdbm02.news.prodigy.net!newsdst02.news.prodigy.net!newscon02.news.prodigy.net!prodigy.net!newsdst01.news.prodigy.net!prodigy.com!postmaster.news.prodigy.com!newssvr27.news.prodigy.net.POSTED!666d6152!not-for-mail
> From: Sqwertz <swertz@cluemail.compost>
> Subject: Re: [Dialog] Help with Scripting
> 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: Organization
> References: <ha9nabr6k714$.dlg@sqwertz.com> <cqn7m0wj9kcv$.vk7yc069kpim.dlg@40tude.net>
> Message-ID: <103fjr2c6hhb1$.dlg@sqwertz.com>
> Archive: no
> Distribution: Test Distrib
> Keywords: Testing Keywords
> Summary: Testing Summary
> X-No-Archive: banter
> X-WebTV-Stationery: Standard; BGColor=red; Background="http://i26.tinypic.com/25polj9.gif"; TextColor=red
> X-No-Archive: banter
> Lines: 57
> NNTP-Posting-Host: 75.55.119.163
> X-Complaints-To: abuse@prodigy.net
> X-Trace: newssvr27.news.prodigy.net 1204347185 ST000 75.55.119.163 (Fri, 29 Feb 2008 23:53:05 EST)
> NNTP-Posting-Date: Fri, 29 Feb 2008 23:53:05 EST
> X-UserInfo1: FKPO@MC@@S@US^T[KROLN[TDFZ\@@FXLM@TDOCQDJ@_@FN\CDVW[AKK[J\]^HVKHG^EWZHBLO^[\NH_AZFWGN^\DHNVMX_DHHX[FSQKBOTS@@BP^]C@RHS_AGDDC[AJM_T[GZNRNZAY]GNCPBDYKOLK^_CZFWPGHZIXW@C[AFKBBQS@E@DAZ]VDFUNTQQ]FN
> Date: Sat, 01 Mar 2008 04:53:05 GMT
> Xref: prodigy.net news.software.readers:264495
> X-Received-Date: Fri, 29 Feb 2008 23:54:15 EST (newsdbm02.news.prodigy.net)
> 
> On Sat, 1 Mar 2008 14:13:11 +1100, Rom wrote:
> 
>> On Fri, 29 Feb 2008 21:44:49 GMT, Sqwertz wrote:
>> 
>>> I'm still trying to figure out why this simple script wants to change 
>>> my existing "X-No-Archive: Yes" into "X-No-archive: banter", 
>>> and  then add another one at the end.  It should add the one at 
>>> the one at the end, but not change by existing 'XNA: Yes' header.
>> [Script]
>>> This script produces headers like:
>> ...
>>> X-No-Archive: banter
>>> X-WebTV-Stationery: Standard; BGColor=red; <wrapped>
>>> Background="http://i26.tinypic.com/25polj9.gif"; TextColor=red
>>> X-No-Archive: banter
>> ...
>>> 
>>> As you can see from my current headers, Dialog inserts the XNA header
>>> from the option in my "Identities" setup options, along with my other
>>> custom X-Header (X-WebTV-Stationery), and then script comes along and
>>> appends another XNA header at the bottom, just before my news-server's
>>> headers are stamped on there.
>>> 
>>> But why does it change the first XNA from "yes" into "banter"?  I have
>>> removed the XNA custom header and redefined it under X-Headers and
>>> Identities, but it still shows up as "banter" instead of "yes" and I
>>> can only assume that this script is changing it.
>> 
>> I've added the following X-Header to my usual:
>> X-WebTV-Stationery: Standard; BGColor=red; Background="http://i26.tinypic.com/25polj9.gif"; TextColor=red
> 
> I'd really like a better picture, that was just the first one I
> saw when I was testing it.  And it work fine judging from the
> negative feedback I've received from WebTV users :-)
> 
>> The 'OnBeforeSendingMessage' script I use has been deleted and now
>> only have the script you posted, which tested fine using Hamster, so
>> I'll see how it goes posting normally.
> 
> Yours looks fine <grumble>.
> 
>> While composing, on the All headers tab, if you select X-No-Archive
>> from X-Headers the drop-down list, does it show yes?
> 
> Yep.  I'll change it to "no" here just for kicks.
> 
> It *used to* say "banter" in my X-Headers settings, but I changed
> it back to "yes".  
> 
> I even did a full text search for the word "banter" (using
> Windows Explorer "Search" util) in my ./40tuee directory and it
> doesn't find banter.  Not even in my Scripts directory for some
> reason.  Weird.
> 
> Now this is pissing me off.

Well, that didn't work either <sigh>.

I wonder what is about my installation that makes it act this
way.  I guess I'll try reinstalling the base package again, and
bring in my previous settings (as backup files) a few at a time.

-sw
Re: [Dialog] Help with Scripting
#217340
Author: Rom
Date: Sat, 01 Mar 2008 07:18
49 lines
2898 bytes
On Sat, 01 Mar 2008 04:53:05 GMT, Sqwertz wrote:

> On Sat, 1 Mar 2008 14:13:11 +1100, Rom wrote:
[...]
>> The 'OnBeforeSendingMessage' script I use has been deleted and now
>> only have the script you posted, which tested fine using Hamster, so
>> I'll see how it goes posting normally.
> 
> Yours looks fine <grumble>.
> 
>> While composing, on the All headers tab, if you select X-No-Archive
>> from X-Headers the drop-down list, does it show yes?
> 
> Yep.  I'll change it to "no" here just for kicks.
> 
> It *used to* say "banter" in my X-Headers settings, but I changed
> it back to "yes".  
> 
> I even did a full text search for the word "banter" (using
> Windows Explorer "Search" util) in my ./40tuee directory and it
> doesn't find banter.  Not even in my Scripts directory for some
> reason.  Weird.

Open these files in a text editor and search for "banter": 

1) ...\40tude Dialog\settings.ini

to make sure banter doesn't exist.
(You may find old identities or those set up for testing purposes are
still present, so clean them up after backing up the file.)

Also check the identity specified on the Posting panel in:
Groups menu > Default group options | Selected group options

2) ...\40tude Dialog\Scripts\Event\OnBeforeSendingMessage.ds

You should find your script here with "banter".

Have you restarted Dialog lately? ;-)

I'd tend to backup the ...\40tude Dialog\Scripts folder, then either
delete OnBeforeSendingMessage.cds and OnBeforeSendingMessage.ds files
from ...\40tude Dialog\Scripts\Event with Dialog closed, or delete the
compiled and active versions of the scripts from within Dialog, and
reload all scripts. Then test by posting a message without scripts.
Add back scripts one at a time - the one you posted first, and test.

-- 
Rom
Re: [Dialog] Help with Scripting
#217346
Author: MikeV06
Date: Sat, 01 Mar 2008 15:07
77 lines
2832 bytes
On Sat, 01 Mar 2008 06:54:01 GMT, Sqwertz wrote:

> Well, that didn't work either <sigh>.
> 
> I wonder what is about my installation that makes it act this
> way.  I guess I'll try reinstalling the base package again, and
> bring in my previous settings (as backup files) a few at a time.
> 
> -sw

Here is what I finally settled on:

program OnBeforeSendingMessage;

   {$I Include_AddAnyHeader.ds}   
   {$I Insert_Boxquotes.ds}   
  
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;
   //
   // This calls the add XNA: banter procedure
   AddAnyHeader ('X-No-Archive: banter', Message, IsEmail);
   AddAnyHeader ('X-Test: Box', Message, IsEmail);
   //
   if Message.count < 500 then BoxQuote( Message );
end;  // function OnBeforeSendingMessage()


BEGIN
end.  

Don't compile the included script:

// 
procedure AddAnyHeader(AddHeader:String; var Message:TStringlist;
IsEmail:Boolean);
var i: integer;
begin
   If not IsEmail then begin
      i := 1;
      while Message[i] <> '' do 
            i := i+1;
      Message.insert(i, AddHeader);
   end;
end;

It looks like it works for me. Box works too.

,---- [AddAnyHeader] 
| // 
| procedure AddAnyHeader(AddHeader:String; var Message:TStringlist;
| IsEmail:Boolean);
| var i: integer;
| begin
|    If not IsEmail then begin
|       i := 1;
|       while Message[i] <> '' do 
|             i := i+1;
|       Message.insert(i, AddHeader);
|    end;
| end;
'----

Mike


Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads