Package: listadmin
Version: 2.40-2.2
Severity: wishlist
Tags: patch

Hi Noel, 

unfortunatly listadmin doesn't support discarding subscription
requests. My simple patch adds support to that feature. It would be
nice if it could get included into the debian package. 

Alex

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.29-2-686 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages listadmin depends on:
ii  libcrypt-ssleay-perl          0.57-1+b1  Support for https protocol in LWP
ii  libtext-reform-perl           1.12.2-1   Perl module for manual text wrappi
ii  libwww-perl                   5.826-1    WWW client/server library for Perl

listadmin recommends no packages.

listadmin suggests no packages.

-- no debconf information
diff --git a/listadmin.pl b/listadmin.pl
index 42b365c..71c7a08 100755
--- a/listadmin.pl
+++ b/listadmin.pl
@@ -254,7 +254,7 @@ sub process_subscriptions {
     }
     my $count = keys (%subscribers);
     my $def = $config->{"subdefault"};
-    my $prompt = 'Accept/Reject/Skip/Quit';
+    my $prompt = 'Accept/Discard/Reject/Skip/Quit';
     $prompt .= " [" . uc($def) . "]" if $def;
     $prompt .= " ? ";
 
@@ -281,6 +281,9 @@ sub process_subscriptions {
 	    } elsif ($ans eq "a") {
 		$change->{$id} = [ "sa" ];
 		last;
+	    } elsif ($ans eq "d") {
+		$change->{$id} = [ "sd" ]; 
+		last; 
 	    } elsif ($ans eq "r") {
 		my $r = prompt ("Why do you reject? [optional] ");
 		unless (defined $r) {
@@ -295,6 +298,7 @@ and pressing Return.
 
   a  Accept    -- allow the user to join the mailing list
   r  Reject    -- notify sender that the request was turned down
+  d  Discard   -- silently discard the request
   s  Skip      -- do not decide now, leave it for later
   q  Quit      -- go on to approving messages
 
@@ -1377,6 +1381,7 @@ sub set_param_values {
 					 "d" => 3,
 					 "sa" => 4, # subscribe approve
 					 "sr" => 2, # subscribe reject
+					 "sd" => 3, # subsribe discard
 				     };
     } else {
 	$data->{"global"}{"actions"} = { "a" => 0,
@@ -1411,7 +1416,7 @@ sub read_config {
 
     my %act = ("approve" => "a", "discard" => "d",
 	       "reject" => "r", "skip" => "s", "none" => "");
-    my %sact = ("accept" => "a",
+    my %sact = ("accept" => "a", "discard" => "d", 
 		"reject" => "r", "skip" => "s", "none" => "");
 
     return undef unless open (CONF, $file);
@@ -1641,7 +1646,7 @@ sub commit_changes {
     for my $id (sort { $a <=> $b } keys %{$change}) {
 	my ($what, $text) = @{$change->{$id}};
 	$params->{$id} = $action->{$what};
-	unless ($what =~ /^s[ar]$/) {
+	unless ($what =~ /^s[ard]$/) {
 	    # we don't log subscription approval or rejects
 	    $log .= sprintf ("%s D:[%s] F:[%s] S:[%s]\n",
 			     $what,

Reply via email to