summaryrefslogtreecommitdiff
path: root/Echolot
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2002-07-03 00:54:40 +0000
committerPeter Palfrader <peter@palfrader.org>2002-07-03 00:54:40 +0000
commit8e615cad321491bade30622b120a4a6fbeff02b3 (patch)
tree2c73db6f31587b76c33e385a6e4a177f60420851 /Echolot
parentbd239ed35a3f31a75689a204ba92043c86bc29db (diff)
Implemented command delete
Implemented command getkeyconfs
Diffstat (limited to 'Echolot')
-rw-r--r--Echolot/Commands.pm6
-rw-r--r--Echolot/Storage/File.pm26
2 files changed, 30 insertions, 2 deletions
diff --git a/Echolot/Commands.pm b/Echolot/Commands.pm
index 86ea89c..d00f2c0 100644
--- a/Echolot/Commands.pm
+++ b/Echolot/Commands.pm
@@ -1,7 +1,7 @@
package Echolot::Commands;
# (c) 2002 Peter Palfrader <peter@palfrader.org>
-# $Id: Commands.pm,v 1.3 2002/07/02 17:03:13 weasel Exp $
+# $Id: Commands.pm,v 1.4 2002/07/03 00:54:40 weasel Exp $
#
=pod
@@ -67,6 +67,10 @@ sub processCommands($) {
Echolot::Globals::get()->{'storage'}->add_address(@args);
} elsif ($command eq 'set') {
Echolot::Globals::get()->{'storage'}->set_stuff(@args);
+ } elsif ($command eq 'getkeyconf') {
+ Echolot::Globals::get()->{'scheduler'}->schedule('getkeyconf', time() );
+ } elsif ($command eq 'delete') {
+ Echolot::Globals::get()->{'storage'}->delete_remailer(@args);
} else {
warn("Unkown command: $_\n");
};
diff --git a/Echolot/Storage/File.pm b/Echolot/Storage/File.pm
index 26b7ed8..cca5015 100644
--- a/Echolot/Storage/File.pm
+++ b/Echolot/Storage/File.pm
@@ -1,7 +1,7 @@
package Echolot::Storage::File;
# (c) 2002 Peter Palfrader <peter@palfrader.org>
-# $Id: File.pm,v 1.19 2002/07/03 00:36:14 weasel Exp $
+# $Id: File.pm,v 1.20 2002/07/03 00:54:40 weasel Exp $
#
=pod
@@ -915,6 +915,30 @@ sub expire($) {
};
+sub delete_remailer($$) {
+ my ($self, $address) = @_;
+
+ unless (defined $self->{'METADATA'}->{'addresses'}->{$address}) {
+ delete $self->{'METADATA'}->{'addresses'}->{$address}
+ } else {
+ cluck("Remailer $address does not exist in addresses")
+ };
+
+ unless (defined $self->{'METADATA'}->{'remailers'}->{$address}) {
+
+ for my $type ( keys %{$self->{'METADATA'}->{'remailers'}->{$address}->{'keys'}} ) {
+ for my $key ( keys %{$self->{'METADATA'}->{'remailers'}->{$address}->{'keys'}->{$type}} ) {
+ $self->pingdata_close_one($address, $type, $key, 'delete');
+ };
+ };
+
+ delete $self->{'METADATA'}->{'remailers'}->{$address}
+ } else {
+ cluck("Remailer $address does not exist in addresses")
+ };
+};
+
+
# sub convert($) {
# my ($self) = @_;