Article View: news.software.readers
Article #261413Re: Request help with 40tude dialog program syntax
From: VanguardLH
Date: Sat, 31 Dec 2016 22:11
Date: Sat, 31 Dec 2016 22:11
72 lines
4800 bytes
4800 bytes
Stijn De Jong <stijndekoning@nlnet.nl> wrote: > I'm not a programmer where I'm just trying to meld two different > onBeforeSendingMessage scripts found in the 40tude script repository > (http://dialog.datalist.org/scripts). > > I can put the two scripts together, but I can't redefine the variable. > The variable seems to take one and only one value! > > That is, I can easily give the variable any value, but I can't seem to > figure out the syntax to *redefine* that variable in an "if" statement. > > This pseudocode tries to explain what I'm trying to accomplish: > if identity = id1 then > Remove_Headers='User-Agent: ,Message-ID: '; > else if identity = id2 then > Remove_Headers='User-Agent: ,Content-Transfer-Encoding: '; > else > Remove_Headers='User-Agent: ,Mime-Version: '; > > To help you help me, I'll post the exact code I'm using, but at the risk of > confusing things (because the code is a few hundred lines long). > > Essentially, all I'm trying to do is set the headers based on the identity. > Nothing more fancy than that. > > I'm asking for syntax help because everything I try, by trial and error, > has caused an error, simply because I don't know how to redefine the > RemoveHeader variable syntactically. Okay, I'll bite. Why do you have to remove Dialog's own generated Message-ID header that you told it to add instead of just configuring Dialog to not add the header in the first place (and have the server add its own MID header)? I do NOT have Dialog add a MID header. I let the server add the MID header. According to NNTP RFCs, the server will add the MID header *if* the client did not already add one. I would prefer servers discard any client-added MID header and always add the server's own MID header but the RFCs say the client can do it. If you configure Dialog to NOT add a MID header then there isn't one to remove. Sorry, I've not bothered to lie about what NNTP client that I use or keep it a secrete so I don't know how to configure Dialog to not add a UA header. While I know you can use a macro (script) to iterate through a received message to parse and modify it (which is how I get rid of those worthless PGP "sigs" in the body of a message), I don't that you could do the same line-by-line iteration through a document that has not yet been sent by Dialog. For more detailed info about how to write macros on events in Dialog, and since you cross-posted to the news.software.readers newsgroup, you might want to wait until Bernd Rose shows up. He knows the inner workings of Dialog and better understands the internal structures and variables known and used by Dialog. There is no documentation on the environment in which the macros will run so too often a user has no clue on how to code the script (which becomes a fragment in the main program). If he doesn't respond, you might want to start a new thread, like "Ping Bernd Rose - <topic>". Hopefully he still visits the news.software.readers newsgroup. For scripting in Dialog, you use ":=" to assign/test a value to/of a variable, not "=". You should not attempt to "redefine that variable" in an if-statement. While it is doable, like in C, it means you are trying to alter the value on which you intent to test its value. In a for-statement, yes, you do want to change the variable's value on each iteration of the for-loop but you do not change its value when testing the current value of the variable. Sorry, but to me it looks like you are trying to avoid recognitions of your nyshifting and your socks by making your header vary when using different identities in Dialog. There's no reason to change all those headers between different identities other than to alter your fingerprint for each of your sock puppets.
Technical Details
Message-ID:
<ecqoolFe6djU1@mid.individual.net>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.(126883).mbox.7z!not-for-mailReferences:
<o491jh$7jr$1@gioia.aioe.org>Show Full Headers
Complete Article Headers
Message-ID: <ecqoolFe6djU1@mid.individual.net> Subject: Re: Request help with 40tude dialog program syntax Date: Sat, 31 Dec 2016 16:11:33 -0600 From: VanguardLH <V@nguard.LH> References: <o491jh$7jr$1@gioia.aioe.org> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.(126883).mbox.7z!not-for-mail Newsgroups: news.software.readers,alt.windows7.general Organization: Usenet Elder Lines: 73 Sender: VanguardLH <> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: individual.net +2NBpVDFJzWCuA2BM+K8ygMG9isgsYws+Nmg6atH/aUMYl9XC1 Keywords: VanguardLH VLH811 Cancel-Lock: sha1:K8vqcrgb1WXStcoUfskG+MZPG6o= User-Agent: 40tude_Dialog/2.0.15.41 X-Received-Body-CRC: 2002958892 X-Received-Bytes: 4663