Subj : Re: newsutil.js - content
To   : Ash-Fox
From : Digital Man
Date : Tue Nov 20 2007 05:34 pm

 Re: Re: newsutil.js - content
 By: Ash-Fox to Digital Man on Tue Nov 20 2007 07:14 pm

> Digital Man wrote:
>
> >
> > I'm not really sure what to suggest in that case. <shrug>
> >
>
> Well after a bit of thinking, I came up with this code, which appears to
> work well. It's a bit of hack though, and I'm not sure if this logic does
> enough to determine a message came from usenet.
>
>         if(content_type==undefined) {
>                 //Check that we're not from Fidonet
>                 if(hdr.ftn_area==undefined) {
>                         //If we don't have a ftn, we're likely not from usen
>                         if(hdr.ftn_pid==undefined) { content_type_header();
>                 }
>                 //We're from fidonet, need a header.
>                 else { content_type_header(); }
>         }
> }
>
> function content_type_header()
> {
>         /* No content-type specified, so assume IBM code-page 437 (full ex-A
> */
>         writeln("Content-Type: text/plain; charset=IBM437");
>         writeln("Content-Transfer-Encoding: 8bit");
> }
>
> Do you think I need to add any other checks?

The correct way to check if a message came from a network (any network) is to
see if hdr.from_net_type!=NET_NONE. If you specifically want to see if the
message came from the Internet (e.g. USENET), then check if
hdr.from_net_type==NET_INTERNET.

                                      digital man (xbox-live: digitlman)

Snapple "Real Fact" #72:
The average person uses 150 gallons of water per day for personal use.
Norco, CA WX: ---.-�F, --% humidity, NaN mph --- wind, --.-- inches rain/24hrs

---
� Synchronet � Vertrauen � Home of Synchronet � telnet://vert.synchro.net