diff options
author | Peter Palfrader <peter@palfrader.org> | 2007-11-08 15:04:52 +0000 |
---|---|---|
committer | weasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede> | 2007-11-08 15:04:52 +0000 |
commit | 9956db2ba168028f5e4725a44bb21dddbf5daf29 (patch) | |
tree | 464beae6651899df8d90c3fd0a758def19989002 | |
parent | 6c70d96d441a569264849c494672ab42228ffa86 (diff) |
Do not use subject for finding out who has changed what
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@304 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
-rwxr-xr-x | parse-wiki | 27 |
1 files changed, 10 insertions, 17 deletions
@@ -25,8 +25,6 @@ $project = $1; die ("Project is not a nice name.\n") unless defined $project; -my $from; -my $what; my $is_base64 = 0; @@ -54,34 +52,23 @@ while (defined($line = shift @mail)) { } while (defined($line = shift @headers)) { - if ($line =~ m/^Subject:\s+(?:\[.*?\]\s+)?(?:Trivial )?Update\s+of\s+"(.*)"\s+by\s+(.*?)\s*$/s) { - $what = $1; - $from = $2; - # =?utf-8?q?=5BOFTC=5D_Update_of_=22OFTC=22_by_PeterPalfrader?= - # =?utf-8?q?=5BOFTC=5D_Update_of_=22Staff=22_by_SethArnold?= - } elsif ($line =~ m/^Subject: (?:\[.*?\] )?=\?utf-8\?q\?=5BOFTC=5D_(?:Trivial_)?Update_of_=22(.*)=22_by_(.*?)\?=$/s) { - $what = $1; - $from = $2; - } elsif ($line =~ m/^Content-Transfer-Encoding: base64$/s) { + if ($line =~ m/^Content-Transfer-Encoding: base64$/s) { $is_base64 = 1; } elsif ($line =~ m/^$/) { last; } }; -$from =~ s/\?=\s*=\?utf-8\?q\?//sg; - -die ("$PROGRAM_NAME - $project: No author found.\n") unless defined $from; -die ("$PROGRAM_NAME - $project: No what found.\n") unless defined $what; - my $body = join '', @mail; $body = decode_base64($body) if ($is_base64); my $message; my $url; +my $from; my @lines = split(/\n/, $body); while (defined($line = shift @lines)) { - if ($line =~ m/^The following page has been changed by /) { + if ($line =~ m/^The following page has been changed by (.*):/) { + $from = $1; $url = shift @lines } elsif ($line =~ m/^The comment on the change is:/) { $message = shift @lines; @@ -89,6 +76,12 @@ while (defined($line = shift @lines)) { }; }; +die ("$PROGRAM_NAME - $project: No author found.\n") unless defined $from; +die ("$PROGRAM_NAME - $project: No url found.\n") unless defined $url; +$from =~ s/\?=\s*=\?utf-8\?q\?//sg; + +my $what = $url; +$what =~ s#https?://[^/]*/[^/]*/##; my $notice = (defined $message) ? "$from updated $what: $message" : "$from updated $what"; |