X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Funset%2Fbuddy.pl;fp=cmd%2Funset%2Fbuddy.pl;h=bfea54d795b9c631bddc646c1e9eb0ab287e6997;hb=679037f49e292b15a73dce96699c15b9e3049711;hp=0000000000000000000000000000000000000000;hpb=3c6b5ea97e035155d995e1c1f203e975ae8a1e22;p=spider.git diff --git a/cmd/unset/buddy.pl b/cmd/unset/buddy.pl new file mode 100644 index 00000000..bfea54d7 --- /dev/null +++ b/cmd/unset/buddy.pl @@ -0,0 +1,26 @@ +# +# remove a buddy from the list +# +# Copyright (c) 2006 - Dirk Koopman G1TLH +# +# $Id$ +# + +my ($self, $line) = @_; +my @args = split /\s+/, uc $line; +my $buddies; +my @out; + +my @buddies = @{$self->user->buddies}; + +foreach my $call (@args) { + push(@out, $self->msg('e22', $call)), next unless is_callsign($call); + next if $call eq $self->call; + @buddies = grep $_ ne $call, @buddies; + push @out, $self->msg('buddyu', $call); +} + +$self->user->buddies(\@buddies); +$self->user->put; + +return (1, @out);