--- /dev/null
+#**************************************************************************
+# 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 *
+# the Free Software Foundation; either version 2 of the License, or *
+# (at your option) any later version. *
+# *
+# This program is distributed in the hope that it will be useful, *
+# but WITHOUT ANY WARRANTY; without even the implied warranty of *
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+# GNU General Public License for more details. *
+# *
+# You should have received a copy of the GNU General Public License *
+# along with this program; if not, write to the *
+# Free Software Foundation, Inc., *
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
+#**************************************************************************/
+
+package NDIRC::Commands::Def;
+
+use strict;
+use warnings;
+use feature ':5.10';
+
+use Moose;
+use MooseX::MethodAttributes;
+
+sub anon
+ : Help(syntax: .anon nick message)
+ : Type(def)
+ : ACL(irc_anondef)
+{
+ my ($self,$c,$msg) = @_;
+
+ my ($target,$mess) = $msg =~ /^(\S+) (.*)$/ or die 'ARGS';
+
+ $c->message("msg $target", "<b>$mess</b>");
+ $c->message("msg ".$c->channel, "<c03>$target << $mess</c>");
+}
+
+1;
+
our @ISA = qw/Exporter/;
our @EXPORT = qw/showCall setType takeCall covCall ignoreCall
- defcall anon setDefPrio setCalc getCalc/;
+ defcall setDefPrio setCalc getCalc/;
sub showCall {
my ($msg,$command) = @_;
}
}
-sub anon {
- my ($msg,$command) = @_;
- my ($target,$mess);
- if (defined $msg && $msg =~ /^(\S+) (.+)$/){
- $target = $1;
- $mess = $2;
- }else{
- $ND::server->command("notice $ND::nick Usage: $command nick message");
- return;
- }
- if (dc()){
- $ND::server->command("msg $target ".chr(2).$mess);
- $ND::server->command("msg $ND::target ".chr(3)."3$1 << $2");
- }
-}
-
sub setCalc {
my ($msg,$command) = @_;
my ($id, $calc);
INSERT INTO roles VALUES('irc_setnick');
INSERT INTO roles VALUES('irc_setally');
INSERT INTO roles VALUES('irc_setchannel');
+INSERT INTO roles VALUES('irc_anondef');
INSERT INTO group_roles (gid,role) VALUES(1,'irc_p_nick');
INSERT INTO group_roles (gid,role) VALUES(1,'irc_p_intel');
INSERT INTO group_roles (gid,role) VALUES(1,'irc_setnick');
INSERT INTO group_roles (gid,role) VALUES(1,'irc_setally');
INSERT INTO group_roles (gid,role) VALUES(1,'irc_setchannel');
+INSERT INTO group_roles (gid,role) VALUES(1,'irc_anondef');
INSERT INTO group_roles (gid,role) VALUES(2,'irc_gs');
INSERT INTO group_roles (gid,role) VALUES(2,'irc_scan');
INSERT INTO group_roles (gid,role) VALUES(3,'irc_setnick');
INSERT INTO group_roles (gid,role) VALUES(3,'irc_setally');
INSERT INTO group_roles (gid,role) VALUES(3,'irc_setchannel');
+INSERT INTO group_roles (gid,role) VALUES(3,'irc_anondef');
INSERT INTO group_roles (gid,role) VALUES(4,'irc_points_others');
INSERT INTO group_roles (gid,role) VALUES(4,'irc_a');
INSERT INTO group_roles (gid,role) VALUES(6,'irc_getfleet');
INSERT INTO group_roles (gid,role) VALUES(6,'irc_d');
INSERT INTO group_roles (gid,role) VALUES(6,'irc_sethostile');
+INSERT INTO group_roles (gid,role) VALUES(6,'irc_anondef');
INSERT INTO group_roles (gid,role) VALUES(8,'irc_scanreqs');
INSERT INTO group_roles (gid,role) VALUES(8,'irc_anonscan');
my $disp = new NDIRC::Dispatcher;
-$disp->load('Basic','PA','Channel','Scans','Quotes','Members','Usermgm','Intel');
+$disp->load('Basic','PA','Channel','Quotes','Members','Usermgm','Intel','Def');
$ND::scanchan = '#testarmer';
-$disp->add_channel('#testarlite', ['pub','help','channel','def']);
+$ND::defchan = '#testarlite';
+$ND::memchan = '#testarmer';
+$disp->add_channel($ND::defchan, ['pub','help','channel','def']);
$disp->add_channel($ND::scanchan, ['pub','help','channel','scan','member']);
$disp->add_channel('pm', ['pub','help','pm']);