X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Funset%2Fbuddy.pl;fp=cmd%2Funset%2Fbuddy.pl;h=bfea54d795b9c631bddc646c1e9eb0ab287e6997;hb=bec51340e4ff087605bf58492a53f1fccafc3f74;hp=0000000000000000000000000000000000000000;hpb=0c1c96327393053480f6821560d58f3fb8f13409;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);