[siesta-commit] siesta/lib/Siesta/Plugin Debounce.pm,1.2,1.3

[prev] [thread] [next] [lurker] [Date index for 2002/08/23]

From: clampr
Subject: [siesta-commit] siesta/lib/Siesta/Plugin Debounce.pm,1.2,1.3
Date: 18:17 on 23 Aug 2002
Update of /cvsroot/siesta/siesta/lib/Siesta/Plugin
In directory usw-pr-cvs1:/tmp/cvs-serv1267

Modified Files:
	Debounce.pm 
Log Message:
refactor from Seen.

This is so damn easy!


Index: Debounce.pm
===================================================================
RCS file: /cvsroot/siesta/siesta/lib/Siesta/Plugin/Debounce.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Debounce.pm	20 Aug 2002 16:17:06 -0000	1.2
+++ Debounce.pm	23 Aug 2002 17:16:58 -0000	1.3
@@ -2,9 +2,23 @@
 use strict;
 use Siesta::Plugin;
 use base 'Siesta::Plugin';
-
 use vars qw/$DESCRIPTION/;
-$DESCRIPTION = "handles bounces.";
+$DESCRIPTION = "handles bounces/loops.";
+
+sub process {
+    my $self = shift;
+    my $mail = shift;
+
+    my $post = $mail->list->post_address;
+    for my $been ($mail->list->get('X-Been-There')) {
+        chomp $been;
+        # have we been here before?
+        return 1 if $been eq $post;
+    }
+
+    $mail->head->add('X-Been-There', $post);
+    return;
+}
 
 1;
 



Generated at 13:57 on 01 Jul 2004 by mariachi 0.52