X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=ndawn.pl;h=d61640d4c6c068e82c9ae1653b0d824ea6d2da8a;hb=fb91afb326b44a3e46fb92b060696aabc343e1cc;hp=76fca28c3d6899574ffaeecae66831cee0004f25;hpb=491db8f0abea3c779a1ecdc64f22ed233bc9546b;p=NDIRC.git diff --git a/ndawn.pl b/ndawn.pl index 76fca28..d61640d 100644 --- a/ndawn.pl +++ b/ndawn.pl @@ -1,5 +1,5 @@ #************************************************************************** -# Copyright (C) 2008 by Michael Andreen * +# Copyright (C) 2009 by Michael Andreen * # * # 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 * @@ -55,17 +55,28 @@ my $TICK = $DBH->selectrow_array('SELECT tick()'); my $disp = new NDIRC::Dispatcher; -$disp->load('Basic','PA','Channel','Scans'); +$disp->load('Basic','PA','Channel','Scans','Quotes'); $ND::scanchan = '#testarmer'; $disp->add_channel('#testarlite', ['pub','help','channel']); -$disp->add_channel('#testarmer', ['pub','help','channel','scan']); +$disp->add_channel($ND::scanchan, ['pub','help','channel','scan']); $disp->add_channel('pm', ['pub','help','pm']); 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 }