🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.misc
Article #2295

Re: Threading articles

#2295
From: Johnny Favorite
Date: Mon, 23 Oct 2000 00:00
37 lines
2643 bytes
aclexports@usa.net wrote:
> Can someone point me out to a source of info on how articles are
> threaded. How do newsreaders recognize which articles to thread and in
> what order. Is the entire information contained in the References
> header only ? I am writing a my own code to retrieve articles from an
> NNTP server and display them in HTML format. I would like to thread
> the headers I retrieve. Whats the easiest way ?

Oooh ooh oooh I know that one!

Yes, the information is all in the References header.  Notice that a
top-level post doesn't have one.  A reply to a top-level post will have
the message ID of the replied-to message as its sole References entry.
A reply to the reply will have the message ID of the root-level message
then the first reply.  And so on.

When displaying an article you may not have all of the messages referred
to in its References header, so the optimal parent for a given message
may not be there.  What I do in that case is work my way backwards
through the references until I find one that *is* available and use
that.

It gets trickier if the header gets really long.  You're not supposed to
create a references header that's longer than 998 chars, contains more
than 20 message IDs, or is "line-folded."  Of course some newsreaders do
anyway but it's not good form.  What I do in my newsreader is always
keep the root-level message ID no matter what so that it's possible to
group together all messages that belong in the same thread.  If
References is too long in a message I'm creating I start peeling them
off at the second ID until I get it down to a max 20 IDs and 998 chars.

Some newsreaders attempt to thread messages that lack References headers
by comparing subject lines and assuming ones that start with Re: are
replies.  That sounded too hairy to me so I treat anything without
References as a top-level post.

Technical Details
Message-ID: <PM0003745A5E173BD1@cobalt.oceania.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
References: <39f4d89b.7979358@news.alt.net>

Show Full Headers
Complete Article Headers
Message-ID: <PM0003745A5E173BD1@cobalt.oceania.com>
Subject: Re: Threading articles
Date: Mon, 23 Oct 2000 00:00:00 +0000
From: Johnny Favorite (it means "Umlaut Restoration Act of 1986") <allen@snakebite.com>
References: <39f4d89b.7979358@news.alt.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
X-Deja-AN: 685089460
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=ISO-8859-1
Organization: Hell, Inc.
Mime-Version: 1.0
Newsgroups: news.software.readers,news.software.misc,news.software.nntp
X-Program-URL: http://www.concentric.net/~brunsona/pineapplenews.html