]> ruin.nu Git - NDIRC.git/blobdiff - ndawn.pl
Converted sendScan and called it anon for scanners too
[NDIRC.git] / ndawn.pl
index 76fca28c3d6899574ffaeecae66831cee0004f25..d805d75fe8685748dc26f6da1aaa253bfc17cc6b 100644 (file)
--- a/ndawn.pl
+++ b/ndawn.pl
@@ -1,5 +1,5 @@
 #**************************************************************************
-#   Copyright (C) 2008 by Michael Andreen <harvATruinDOTnu>               *
+#   Copyright (C) 2009 by Michael Andreen <harvATruinDOTnu>               *
 #                                                                         *
 #   This program is free software; you can redistribute it and/or modify  *
 #   it under the terms of the GNU General Public License as published by  *
@@ -66,6 +66,17 @@ sub event_pubmsg {
        my ($server, $msg, $nick, $address, $channel) = @_;
 
        eval {
+               if ($msg =~ /^(\S+): (.+)$/ && $disp->has_command('anon',$channel)){
+                       my $_ = $1;
+                       my $text = $2;
+                       my $channel = $server->channel_find($channel);
+                       my $nick = $channel->nick_find($1);
+                       unless ($nick || /(Constructing|Researching)/){
+                               print ".anon $_ $text";
+                               $msg = ".anon $_ $text";
+                       }
+
+               }
                if (parseCommand($msg,$server,$nick,$address,$channel,$disp,DB())){
                        #Command parsed and run successfully
                }