Article View: news.software.readers
Article #259622Re: 40tude Dialog: Anyway to keep it from deleting local copies of articles?
From: VanguardLH
Date: Sun, 04 Oct 2015 14:11
Date: Sun, 04 Oct 2015 14:11
119 lines
5931 bytes
5931 bytes
Looked at the scripts. The message scripts are irrelevant because each
is defined on a mouse action. Since I am not clicking on anything just
to see the Repository folder get bolded then those scripts are not
executed. The custom scripts are defined for use with toolbar buttons,
like buttons to change views (instead of wading through menus). Again,
I'm not clicking any toolbar buttons when I see the Repository folder
get bolded when new articles are retrieved.
I looked at the event scripts. The only non-empty ones are:
OnTimer1: Used to define poll interval for e-mail but I don't use Dialog
for e-mail.
OnTimer2: Used to define poll interval for newsgroups. Runs:
lockdisplay;
try
ADo('GetNewHeadersInSubscribedGroups'); // Get new newsgroup posts.
finally
unlockdisplay;
end;
OnStartup: Runs the same commands as OnTimer1 and OnTimer2. The timed
polls do not include zero seconds so this event forces Dialog
to do a poll when it loads. Also runs:
timer1.interval:=60000*5; // Get e-mails at 5-minute intervals.
timer1.enabled:=true; // Used by OnTimer1 event script.
timer2.interval:=60000*5; // Get newsgroups posts at 5-minute intervals.
timer2.enabled:=true; // Used by OnTimer2 event script.
All the other events are blank except for OnBeforeSavingMessage. This
one is defined to remove superfluous PGP signatures. No one is going to
waste time checking someone's claimed PGP signature to verify they did
not forge someone else's identity. The worthless PGP sigs are a
nuisance when included in the body of an article, so this script removes
those signatures. It runs:
____________________
//Remove PGP signature from newsgroup messages
program OnBeforeSavingMessage;
const pgp_headline='-----BEGIN PGP SIGNED';
const pgp_sig_start='-----BEGIN PGP SIGNATURE-----';
const pgp_sig_end='-----END PGP SIGNATURE-----';
const pgp_sig_fix='- -- ';
const maxint=2147483647;
procedure OnBeforeSavingMessage(var Message: TStringlist; Servername:
string; IsEmail: boolean);
var i,j:integer;
s:string;
begin
if isemail=true then exit;
for i:= 0 to message.count-1 do
begin
if pos(pgp_headline, message.strings[i]) > 0 then
begin
// delete the '...PGP SIGNED...' line
message.delete(i);
// delete the 'Hash: foo' line now at index "i".
message.delete(i-1);
// insert notice
// message.insert(i,'---PGP sig removed---');
end;
if pos(pgp_sig_fix, message.strings[i]) > 0 then
begin
// delete the broken signature delimiter '- -- ' and replace it with '-- '
message.delete(i);
message.insert(i,'-- ');
// exit the "i" loop
break;
end;
end;
//setup to delete pgp signature
s:=message.text;
//locate start of pgp signature
i:=pos(pgp_sig_start,s);
begin
//find length of pgp signature string
j := i + pos(pgp_sig_end,copy(s, i, maxint));
if j > i then
begin
//delete pgp signature string
delete(s, i, j-i + length(pgp_sig_end) +1);
message.text:=s;
end;
end;
end;
begin
end.
___________________
While this script modifies an article, it only modifies the body of the
article. I don't see that it affects the state of the article (i.e.,
marked read/unread status). Also, it has been a long time since I ran
across someone who thinks PGP signatures has any real value (versus
stroking their ego). I haven't ran across an article with the PGP
delimiters in the body of an article. Since the newly retrieved
articles do not have the PGP sig block, the first 'if' fails. The 2nd
'if' fails, too. I commented out the alert message since I don't care
when the script removed the bogus PGP sig block if there was one. The
last 'if' fails, too, if there is no PGP sig block. I got this script
from elsewhere from someone else who doesn't want the nuisance of having
to read the message inside the PGP sig block delimiter lines.
I don't see anything here that would change the state (marked read or
unread) of a newly retrieved article.
Technical Details
Message-ID:
<d7cqckFjqpgU1@mid.individual.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.(126883).mbox.7z!not-for-mailReferences:
<d6optbFjbkcU1@mid.individual.net> <18x37jj2k3tuj.dlg@b.rose.tmpbox.news.arcor.de> <d6prtfFqtfaU1@mid.individual.net> <xmtv98kwnp60$.dlg@b.rose.tmpbox.news.arcor.de> <d6qkb8F2i48U1@mid.individual.net> <1im02jq0il8ly$.2ye0mpql50be$.dlg@40tude.net> <d7batdF8r4fU1@mid.individual.net> <19a05emalh5k9.dlg@b.rose.tmpbox.news.arcor.de> <d7c4asFea6gU1@mid.individual.net> <d7c61kFenquU1@mid.individual.net> <d7c6r4Fetr1U1@mid.individual.net> <3y5ks5yihoo7$.dlg@b.rose.tmpbox.news.arcor.de> <d7cnstFj6i8U1@mid.individual.net> <d7cnv9Fj6shU1@mid.individual.net>Show Full Headers
Complete Article Headers
Message-ID: <d7cqckFjqpgU1@mid.individual.net> Subject: Re: 40tude Dialog: Anyway to keep it from deleting local copies of articles? Date: Sun, 4 Oct 2015 09:11:30 -0500 From: VanguardLH <V@nguard.LH> References: <d6optbFjbkcU1@mid.individual.net> <18x37jj2k3tuj.dlg@b.rose.tmpbox.news.arcor.de> <d6prtfFqtfaU1@mid.individual.net> <xmtv98kwnp60$.dlg@b.rose.tmpbox.news.arcor.de> <d6qkb8F2i48U1@mid.individual.net> <1im02jq0il8ly$.2ye0mpql50be$.dlg@40tude.net> <d7batdF8r4fU1@mid.individual.net> <19a05emalh5k9.dlg@b.rose.tmpbox.news.arcor.de> <d7c4asFea6gU1@mid.individual.net> <d7c61kFenquU1@mid.individual.net> <d7c6r4Fetr1U1@mid.individual.net> <3y5ks5yihoo7$.dlg@b.rose.tmpbox.news.arcor.de> <d7cnstFj6i8U1@mid.individual.net> <d7cnv9Fj6shU1@mid.individual.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.(126883).mbox.7z!not-for-mail Newsgroups: news.software.readers Organization: Usenet Elder Lines: 119 Sender: VanguardLH <> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: individual.net fDYSNNHtMq5jCb/9iVtC1w38ozg6RsF49mexrM3WTQc25LMCQZ Keywords: VanguardLH VLH811 Cancel-Lock: sha1:Dd9H01rqlsxNxbJorHY6r97qA94= User-Agent: 40tude_Dialog/2.0.15.41 X-Received-Bytes: 5865 X-Received-Body-CRC: 1576900668