🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #116210

Re: [SLRN] compose-hook() ???

#116210
From: Lee J. Moore
Date: Wed, 18 Dec 2002 14:22
42 lines
2551 bytes
One may as well begin with reggie's letter to news.software.readers:

[..]
> Myself being new to this, I suggest using
> 
> followup_hook, reply_hook and post_hook

Thanks Reggie.  It's a pity hooks in SLRN can't be approached
the same way as hooks in Mutt.  Manipulating headers on hook
conditions seems so much more concise in Mutt.  Anyway, task
accomplished so thanks for your help.  :)

I wonder if anybody here has come up with a sscanf() format
capable of getting the header name *and* header value from a
string.  For example:

	sscanf(header, "%[^:]", &hdr);

That puts the header name (everything up to the colon) in the
variable hdr, but I can't figure out a way to do something like
this:

	sscanf(header, "%[^:]: %[^]", &hdr, &val);

The [^] is invalid because ^ must be followed by something.
Eg. [^\n] means - return everything except newlines.  But I'd
like *everything* after the colon.  My workaround to get the
header value (ie. everything after the colon) seems clunky:

	define get_header_value(header){
	        variable val = is_substr(header, ":");
		return strtrim(substr(header, val+1, -1));
	}

Intrinsic SLRN functions like extract_article_header() are of no
use because the headers don't come from a displayed article, but
from the config file (custom_headers).

--
Lee John Moore           :   'Only Connect...'
www.leej.dsl.pipex.com   :        - EM Forster
Technical Details
Message-ID: <slrnb0115m.n4t.leej@cafe.lan>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!userdg058.dsl.pipex.COM!not-for-mail
References: <slrnavu70p.6gb.leej@cafe.lan> <FRML9.182113$ea.3697032@news2.calgary.shaw.ca>

Show Full Headers
Complete Article Headers
Message-ID: <slrnb0115m.n4t.leej@cafe.lan>
Subject: Re: [SLRN] compose-hook() ???
Date: Wed, 18 Dec 2002 14:22:50 +0000
From: "Lee J. Moore" <leej@dsl.pipex.com>
References: <slrnavu70p.6gb.leej@cafe.lan> <FRML9.182113$ea.3697032@news2.calgary.shaw.ca>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!userdg058.dsl.pipex.COM!not-for-mail
Newsgroups: news.software.readers
Lines: 41
NNTP-Posting-Host: userdg058.dsl.pipex.com (62.190.230.58)
X-Trace: fu-berlin.de 1040221370 1687361 62.190.230.58 (16 [129053])
X-Platform: Gentoo Linux (Portage 2.0.45-r5)
X-Kernel: 2.4.19-gentoo-r10
X-Spam-Info: Incoming mail analysed and filtered by SpamAssassin
X-Spam-Info: Detected SPAM submitted to Vipuls Razor
User-Agent: slrn/0.9.7.4 (Linux)