From: Ian Jackson Date: Thu, 4 Mar 2010 17:23:17 +0000 (+0000) Subject: Deal more sensibly with various combinations of input format X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~webstump/git?p=modbot-mtm.git;a=commitdiff_plain;h=a2ed6c226ae9c2705affd66255b2796f000e4433 Deal more sensibly with various combinations of input format --- diff --git a/xlog/bin/record b/xlog/bin/record index 11c7e60..1ba50b7 100755 --- a/xlog/bin/record +++ b/xlog/bin/record @@ -39,16 +39,28 @@ sub parse_posted () { } sub parse_submission () { my $hadng=0; + my %oldf; + my $had2=0; while () { chomp; +print STDERR "$hadng $had2|$_|\n"; $hadng++ if m/^Newsgroups:/i; if (m/^$/) { last if $hadng; + last if $had2++; + %oldf= %f; undef %f; } + last unless m/^\S+\:|^\s|^$|^From /; parse__headerline(); } - $f{Event}= 'receive'; + if ($hadng) { + $f{Event}= $had2 ? 'receive newstyle' : 'receive'; + } else { + %f= %oldf if $had2; + $f{Subject}= '[suppressed]'; + $f{Event}= 'receive junk'; + } } sub parse_stump2webstump () {