[prev] [thread] [next] [lurker] [Date index for 2002/09/09]
Update of /cvsroot/siesta/siesta/lib/Siesta/Plugin In directory usw-pr-cvs1:/tmp/cvs-serv27160/lib/Siesta/Plugin Modified Files: ReplyTo.pm SimpleSig.pm Log Message: Put some config stuff in. Index: ReplyTo.pm =================================================================== RCS file: /cvsroot/siesta/siesta/lib/Siesta/Plugin/ReplyTo.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ReplyTo.pm 28 Aug 2002 09:27:17 -0000 1.2 +++ ReplyTo.pm 9 Sep 2002 11:17:08 -0000 1.3 @@ -2,7 +2,7 @@ use strict; use Siesta::Plugin; use base 'Siesta::Plugin'; -use vars qw/ $DESCRIPTION $MUNGE/; +use vars qw/ $DESCRIPTION /; $DESCRIPTION = "Munges the Reply-To header to the list address, not the person who sent it"; # see : @@ -17,17 +17,35 @@ # DANCE MONKEYS! DANCE! -$MUNGE = 1; - sub process { my $self = shift; my $mail = shift; - my $list = $mail->list; + my $list = $mail->list || undef; - my $post_address = $mail->list->post_address; - $mail->head->replace('Reply-To', $post_address) if $MUNGE; + + my $post_address = (defined $list)? $mail->list->post_address : undef; + my $munge = $self->config($mail,'munge') || $self->options->{munge}->{default}; + + $munge = (defined $post_address)? $munge : 0; + + $mail->head->replace('Reply-To', $post_address) if $munge; return; } + +sub options +{ + return { + 'munge' => { 'description' => 'should we munge the reply-to address of the message to be the list post', + 'type' => 'boolean', + 'default' => 1, + 'widget' => 'checkbox', + } + + }; + + +} + 1; Index: SimpleSig.pm =================================================================== RCS file: /cvsroot/siesta/siesta/lib/Siesta/Plugin/SimpleSig.pm,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- SimpleSig.pm 26 Aug 2002 17:34:52 -0000 1.11 +++ SimpleSig.pm 9 Sep 2002 11:17:08 -0000 1.12 @@ -15,7 +15,7 @@ # some sort of configuration lookup based on list and this plugin name, # however lets just say 5 instead - my $maxlines = 5; + my $maxlines = $self->config($mail,'maxlines') || $self->options->{maxlines}->{default}; my $body = join '', @{ $mail->body() }; my (undef,$sig) = split /-- \n/, $body, 2; @@ -38,11 +38,17 @@ return 0; } -# return -sub list_config { -} -sub user_config { +sub options +{ + return { + 'maxlines' => { + 'description' => 'the maximum number of lines we shoudl allow in the sig before chomping', + 'type' => 'num', + 'default' => 5, + 'widget' => 'textbox', + }, + } } 1;
Generated at 13:57 on 01 Jul 2004 by mariachi 0.52