added chat stuff for fun
[spider.git] / perl / DXCommandmode.pm
index 1750fee157acd6e87d497ec539642a6b08530893..65d5eb0392d4699fa63672f1de400a46900f0f11 100644 (file)
@@ -802,6 +802,26 @@ sub announce
        $self->local_send($target eq 'WX' ? 'W' : 'N', $buf);
 }
 
+# send a chat
+sub chat
+{
+       my $self = shift;
+       my $line = shift;
+       my $isolate = shift;
+       my $to = shift;
+       my $target = shift;
+       my $text = shift;
+       my ($filter, $hops);
+
+       return unless grep uc $_ eq $target, @{$self->{user}->{group}};
+       
+       $text =~ s/^\#\d+ //;
+       my $buf = "$target de $_[0]: $text";
+       $buf =~ s/\%5E/^/g;
+       $buf .= "\a\a" if $self->{beep};
+       $self->local_send('C', $buf);
+}
+
 # send a dx spot
 sub dx_spot
 {