πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #229058

Killing β€œ attribution Lines ” ( ALs ) is tricky.

#229058
From: Jeffβ–²Relf
Date: Mon, 19 Jan 2009 08:31
75 lines
3894 bytes
I've been a regular poster to Usenet since 1991,
I'm not sure if I ever quoted lines using the β€œ > ” character.
My posts remain unblocked everywhere, all the time.

Killing all >quoted lines is easy, and
the β€œ ⏎. ” prefix in front of the original content
tells me that >quoted lines were killed.  I love it ! ( so far )

Killing β€œ attribution Lines ” ( ALs ) is tricky.

If there are blank lines at the start of a post, they are removed.
The span of lines ( up to 5 lines ) from there to the next blank line,
or to >quoted line, may or may not be ALs.

If the span of lines ends in a >quoted line,
then X.EXE considers them ALs and remove them ( by not printing them ).

But, if they end in a blank line, then they are ALs
if-and-only-if they contain something like β€œ Left@Right. ”
and the begining of the line doesn't look like a link
( e.g. β€œ news:Left@Right.COM ” ).

The code ( from JeffRelf.F-M.FM/X.CPP ) looks like this:
//  BB points to the body, an array of lines.
//  P and B will point to the line ( a null terminated string )

PP = BB - 1 ; int SawQ = 0, Smelly = 0 ;  const int MaxAttribLns = 5 ;
while ( ++ PP < EE && PP - BB <= MaxAttribLns && ( P = B = * PP ) ) {
  WhileWhite;
  //  Ch is either null or the first black space in the line.
  if ( >Quoted || Smelly && ! Ch ) {
    //  Make the body of the post start after the ALs.
    BB = PP + 1, SawQ = 1 ; break ;  }
  if ( ! Ch )
    //  β€œ ! Ch ” is true so the line is blank, we're done.
    //  We found no ALs.
    break ;
  
  if ( Smelly || EqiN( L"news:", P, 5 ) || EqiN( L"Google.COM", P, 10 ) 
  || EqiN( L"www.", P, 4 ) || EqiN( L"http:", P, 5 ) )  
    //  This line starts like it's a link, so ignore it.
    continue ;
    
  P = FromStart( P, '@' );
  if ( ! P || P == B || ! Iden( P[ -1 ] ) || ! Iden( P[ 1 ] ) )
    //  No β€œ Left@Right ”, ignore the line.
    continue ;

  //  β€œ ill ” has the β€œ . ” char and
  //  the list of invalid characters for a Right-ID
  
  static LnP ill = L"@.,:;\"()<>[]\\";  P ++ ;  
  While( Ch > 32 && Ch < 127 ) {  
  
    //  We're here while Right-ID has U.S. ASCII black space
    LnP Svd = P ; int C = Ch ; P = ill ;  While( C != Ch ); 
    
    if ( Ch == '.' )
      //  Found the β€œ Left@Right. ”, we're in β€œ Smelly ” ALs.
      Smelly = 1 ; 
    
    int Done = Ch ; P = Svd, Ch = 1 ;  if ( Done ) break ;  } }
            .......
            
inline int Iden( wchar_t C ) {
  return C == '_' || C >= 128 || Alpha_Numeric ( C );  }
  
#define  >Quoted  ( Ch == '>' ||  Ch == '|' )
#define  EqiN  ! wcsnicmp

#define  While( Should_Loop )  Ch = 1 , P -- ;  \
  while ( Ch && ( Ch = * ++ P, Ch2 = ! Ch ? 0 : P[ 1 ], Should_Loop ) )

#define  WhileWhite  While ( Ch && ( Ch <= 32 || Ch == L'ΒΈ' ) )
Technical Details
Message-ID: <Jeff_Relf@Seattle.2009_Jan.19|0.31am|i>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-alt.free.newsservers.20150605.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
References: <80ab9vyazp.fsf@banana.shacknet.nu> <Jeff_Relf@Seattle.2009_Jan.15|3.57am|P> <slrngmuesk.9f.steve@news.mixmin.net> <80k58whdxv.fsf@banana.shacknet.nu> <Jeff_Relf@Seattle.2009_Jan.18|2.34am|t> <slrngn6jsi.gbb.steve@news.mixmin.net>

Show Full Headers
Complete Article Headers
Message-ID: <Jeff_Relf@Seattle.2009_Jan.19|0.31am|i>
Subject: Killing β€œ attribution Lines ” ( ALs ) is tricky.
Date: Mon, 19 Jan 2009 08:31:41 +0000
From: Jeffβ–²Relf <Jeff_Relf@Seattle.Test>
References: <80ab9vyazp.fsf@banana.shacknet.nu> <Jeff_Relf@Seattle.2009_Jan.15|3.57am|P> <slrngmuesk.9f.steve@news.mixmin.net> <80k58whdxv.fsf@banana.shacknet.nu> <Jeff_Relf@Seattle.2009_Jan.18|2.34am|t> <slrngn6jsi.gbb.steve@news.mixmin.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-alt.free.newsservers.20150605.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
Newsgroups: alt.free.newsservers,news.software.readers
Lines: 75
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net xuB3a0FK3AikY47q8xnxpg0Yo/aeSq7Cl+Ah2CGHvz1hol6d/o
Cancel-Lock: sha1:U+GxahZWrLWjOgsDdALDuraAZZY=
User-Agent: JeffRelf.F-M.FM/X.ZIP