🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #69580

Re: [slrn] thread_size() & single article

#69580
From: J.B. Nicholson-Owens
Date: Sat, 23 Dec 2000 05:59
92 lines
4898 bytes
cedric wrote:
> Message-ID: <40uu19.va2.ln@cd24.news.free.fr>

Congratulations on configuring your posting agent to generate a good
message-ID.  I'm sure you'll have no problem generating unique IDs with that
hostname.

> J.B. Nicholson-Owens wrote:

You probably don't want to requote so much of an article in a followup.  It
usually means people will end up downloading multiple copies of the same
article.

> But it happened to me to have some broken threads (having a grand-parent but
> not THE parent) so I completed a little your macro so that I can know if an
> ancestor of an article is present(visually speaking):

Good for you.  I suggest you consider going to the References: header of
each article and getting the last message-ID to determine ancestry rather
than relying on any article to properly list all the message-IDs up to some
ancestor.  Some posting agents will purposefully not include all the
ancestry, they will eliminate some message-IDs from the middle of the posted
References: header to keep the header from growing too long.  It is
reasonable to assume the parent message-ID is the last message-ID listed in
the References: header, however.  Since all you want is what's available in
the header list (visual threading) anyway, you could use this to quickly
determine how many of an article's ancestors are listed with something like
this:

#v+
implements ("my");
static define visible_ancestors ()
{
   % Usage: String_Type[] my->visible_ancestors ([String_Type message-ID]);
   %
   % Returns a string array of ancestors in the header list.  The ancestor
   % list might be incomplete--depending on what's available, the list only
   % goes back until an ancestor wasn't found in the header list or the
   % ultimate parent was found.  If you supply a message-ID, the visible
   % ancestor list is built from that point.  If you don't supply a
   % message-ID, the visible ancestor list is built from the current article.
   %
   % As currently written, this function will not guarantee preserving
   % the collapse status of the supplied message-ID's thread.  I leave
   % putting that in as an excercise for the reader.

   variable
     starting_point = extract_article_header ("Message-ID"),
     ancestry = String_Type[0],
     parent = "";

   if (_NARGS)
     {
        variable child = ();
        if (typeof (child) != String_Type)
          usage (_function_name () + ": supplied message-ID must be a string.");
        !if (locate_header_by_msgid (child, 0))
          usage (_function_name () + ": can\'t find supplied message-ID: " + child);
     }

   while (parent = strchop (extract_article_header ("References"), ' ', 0)[-1],
          parent != "")
     {
        % Prepend this article's message-ID to the ordered list.
        ancestry = [extract_article_header ("Message-ID"), ancestry];
        reshape (ancestry, [length (ancestry)]);

        !if (locate_header_by_msgid (parent, 0)) break;
     }
   
   if (extract_article_header ("Message-ID") != starting_point)
     () = locate_header_by_msgid (starting_point, 0);

   return (ancestry);
}
#v-

You could use this to build a list of ancestors based strictly on what you
can see in the header list.

> I discovered slrn for less than a week, but I've already fallen in love
> with the fantastic possibility to configure his behaviour with a language
> :-)

I agree--extensibility is key.  It's one of the things I look for in
newsreaders now (and not surprisingly a really quick way to eliminate almost
all newsreaders from consideration).  Currently the only newsreader I could
upgrade to would be Gnus.  Every other newsreader I've seen would be a
downgrade.  I stick with slrn because it requires far more reasonable
resources than Gnus. I haven't fully exhausted all slrn can do, which also
helps.
Technical Details
Message-ID: <slrn948fo9.77.jbn@next.forestfield.org>
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!supernews.google.com!sn-xit-02!supernews.com!news-x.support.nl!psinet-eu-nl!unlisys!news.snafu.de!fu-berlin.de!uni-berlin.de!forestfield.ORG!not-for-mail
References: <0ruq19.1q3.ln@127.0.0.1> <slrn9430e5.8v.jbn@next.forestfield.org> <n47s19.4d4.ln@127.0.0.1> <slrn943hbu.8v.jbn@next.forestfield.org> <40uu19.va2.ln@cd24.news.free.fr>

Show Full Headers
Complete Article Headers
Message-ID: <slrn948fo9.77.jbn@next.forestfield.org>
Subject: Re: [slrn] thread_size() & single article
Date: Sat, 23 Dec 2000 05:59:51 +0000
From: jbn@forestfield.org (J.B. Nicholson-Owens)
References: <0ruq19.1q3.ln@127.0.0.1> <slrn9430e5.8v.jbn@next.forestfield.org> <n47s19.4d4.ln@127.0.0.1> <slrn943hbu.8v.jbn@next.forestfield.org> <40uu19.va2.ln@cd24.news.free.fr>
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!supernews.google.com!sn-xit-02!supernews.com!news-x.support.nl!psinet-eu-nl!unlisys!news.snafu.de!fu-berlin.de!uni-berlin.de!forestfield.ORG!not-for-mail
Newsgroups: news.software.readers
Organization: Forest Field OmniMedia
Lines: 91
NNTP-Posting-Host: forestfield.org (208.216.67.173)
X-Trace: fu-berlin.de 977551191 6099251 208.216.67.173 (16 [35848])
User-Agent: slrn/0.9.6.4 (Unix)