From 99a9a2003b31d8b0d72706c62bcb6f990d75aad4 Mon Sep 17 00:00:00 2001
From: Peter Palfrader <peter@palfrader.org>
Date: Sat, 19 Jun 2004 12:53:03 +0000
Subject: Make set fetch=<value> work again and disable and enable actually
 work.

---
 pingd | 39 ++++++++++++++++++++-------------------
 1 file changed, 20 insertions(+), 19 deletions(-)

(limited to 'pingd')

diff --git a/pingd b/pingd
index cf3d89d..8b1d18d 100755
--- a/pingd
+++ b/pingd
@@ -421,7 +421,7 @@ sub command_set(@) {
 	my @argv = @_;
 
 	my @settings;
-	while (scalar @argv && $argv[0] =~ /^(show(?:it)?|ping(?:it)?|fetch(?:it))=(on|off)$/) {
+	while (scalar @argv && $argv[0] =~ /^(show(?:it)?|ping(?:it)?|fetch(?:it)?)=(on|off)$/) {
 		my $name = $1;
 		my $value = $2;
 
@@ -446,22 +446,6 @@ sub command_set(@) {
 	};
 };
 
-sub command_setremailercaps(@) {
-	my @argv = @_;
-
-	my @caps;
-	for my $caps (@argv) {
-		my ($remailer_nick, $remailer_address) = ($caps =~ /^\s*  \$remailer{"(.*)"}  \s*=\s*  "<(.*@.*)>.*";   \s*$/ix);
-		die ("caps '$caps' is not a valid remailer caps line\n") unless (defined $remailer_nick && defined $remailer_address);
-		push @caps, {
-			address => $remailer_address,
-			caps => $caps };
-	};
-	for my $caps (@caps) {
-		Echolot::Commands::addCommand("setremailercaps ".$caps->{'address'}." ".$caps->{'caps'});
-	};
-};
-
 sub command_enabledisable (@) {
 	my @argv = @_;
 
@@ -476,9 +460,26 @@ sub command_enabledisable (@) {
 	};
 	my @cmd = ("showit=$value", "pingit=$value", "fetch=$value");
 	push @cmd, @argv;
-	command_setremailercaps(@argv);
+	command_set(@cmd);
 }
 
+
+sub command_setremailercaps(@) {
+	my @argv = @_;
+
+	my @caps;
+	for my $caps (@argv) {
+		my ($remailer_nick, $remailer_address) = ($caps =~ /^\s*  \$remailer{"(.*)"}  \s*=\s*  "<(.*@.*)>.*";   \s*$/ix);
+		die ("caps '$caps' is not a valid remailer caps line\n") unless (defined $remailer_nick && defined $remailer_address);
+		push @caps, {
+			address => $remailer_address,
+			caps => $caps };
+	};
+	for my $caps (@caps) {
+		Echolot::Commands::addCommand("setremailercaps ".$caps->{'address'}." ".$caps->{'caps'});
+	};
+};
+
 sub command_deleteremailercaps(@) {
 	my @argv = @_;
 
@@ -774,7 +775,7 @@ if ($COMMAND eq 'add' || $COMMAND eq 'delete') {
 	command_set(@ARGV);
 	hup_if_wanted($params->{'nohup'});
 } elsif ($COMMAND eq 'enable' || $COMMAND eq 'disable') {
-	command_enabledisable(@ARGV);
+	command_enabledisable($COMMAND, @ARGV);
 	hup_if_wanted($params->{'nohup'});
 } elsif ($COMMAND eq 'deleteremailercaps') {
 	command_deleteremailercaps(@ARGV);
-- 
cgit v1.2.3