sub NICK($) {
my ($event, @args);
+ #>> 32 :erry_ & erry2 :1310809099
if($_[0] =~ /^:(\S+) (?:NICK|\&) (\S+) :?(\S+)$/) {
- return ('NICKCHANGE', undef, undef, WF_NICK, $1, $2, $3);
+ my $user = {NICK=>$1};
+ return ('NICKCHANGE', undef, undef, WF_NICK, $user, $2, $3);
}
elsif(CLK && NICKIP && $_[0] =~ /^(?:NICK|\&) (\S+) (\d+) (\S+) (\S+) (\S+) (\S+) (\d+) (\S+) (\S+) (\S+) (\S+) :(.*)$/) {
#NICK Guest57385 1 !14b7t0 northman tabriel.tabris.net 38 0 +iowghaAxNWzt netadmin.SCnet.ops SCnet-3B0714C4.tabris.net CgECgw== :Sponsored By Skuld
}
sub QUIT($) {
- if ($_[0] =~ /^:(\S+) QUIT :(.*)$/) {
- my $user = { NICK=>$1 };
- return ('QUIT', 0, undef, WF_NICK, $user, $2);
- }
+ print "?????????/";
+ $_[0] =~ /^:(\S+) (?:QUIT|\,) :(.*)$/;
+ my $user = { NICK=>$1 };
+ return ('QUIT', 0, undef, WF_NICK, $user, $2);
}
sub KILL($) {
sub setsvsstamp($$$) {
my ($src, $dst, $stamp) = @_;
-
- ircsend(":$src SVS2MODE $dst +d $stamp");
+ my $srcN = $src->{NICK};
+ my $dstN = $dst->{NICK};
+ ircsend(":$srcN SVS2MODE $dstN +d $stamp");
# This function basically set the svsstamp to
# be the same as the userid. Not all ircd will
# support this function.
use SrSv::Agent;
use SrSv::Conf2Consts qw( main );
-my $esnick = 'EchoServ';
-
-addhandler('PRIVMSG', undef, lc $esnick, 'echoserv::ev_privmsg');
-sub ev_privmsg { ircd::privmsg($_[1], $_[0], $_[2]) }
+my $esnick_default = 'EchoServ';
+my $esnick = $esnick_default;
+addhandler('PRIVMSG', undef, undef, 'echoserv::ev_privmsg');
+our $esuser = { NICK => $esnick, ID => "123AAAAAI" }; #FIXME = erry
+sub ev_privmsg {
+ $esuser = { NICK => $esnick, ID => "123AAAAAI" }; #FIXME = erry
+ my ($user, $dstUser, $msg) = @_;
+ return unless (lc $dstUser->{NICK} eq lc $esnick);
+ ircd::privmsg($dstUser, $user->{ID}, $msg);
+}
addhandler('NOTICE', undef, lc $esnick, 'echoserv::ev_notice');
-sub ev_notice { ircd::notice($_[1], $_[0], $_[2]) }
+sub ev_notice {
+ $esuser = { NICK => $esnick, ID => "123AAAAAI" }; #FIXME = erry
+ my ($user, $dstUser, $msg) = @_;
+ return unless (lc $dstUser->{NICK} eq lc $esnick);
+ ircd::notice($dstUser, $user, $msg);
+}
agent_connect($esnick, 'services', undef, '+pqzBGHS', 'Echo Server');
agent_join($esnick, main_conf_diag);
--- /dev/null
+# This file is part of SurrealServices.
+#
+# SurrealServices 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.
+#
+# SurrealServices 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 SurrealServices; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+package echoserv;
+use strict;
+
+use SrSv::IRCd::Event qw( addhandler );
+use SrSv::Agent;
+use SrSv::Conf2Consts qw( main );
+
+my $nnsnick_default = 'NullServ';
+my $nnsnick = $nsnick_default;
+
+agent_connect($nnsnick, 'services', undef, '+pqzBGHS', 'Null Server');
+agent_join($nnsnick, main_conf_diag);
+ircd::setmode($nnsnick, main_conf_diag, '+o', $nnsnick);
+
+sub init { }
+sub begin { }
+sub end { }
+sub unload { }
+
+1;
our $bsnick = $bsnick_default;
our $botchmode;
our $bsuser = { NICK => $bsnick, ID => "123AAAAAF" };
-if(!ircd::PREFIXAQ_DISABLE() && $IRCd_capabilities{"FOUNDER"} ne "" && $IRCd_capabilities{"ADMIN"} ne "") {
- $botchmode = '+q';
-} else {
- $botchmode = '+o';
-}
-print Dumper ($botchmode);
+
*agent = \&chanserv::agent;
our $calc_safe = new Safe;
unless(is_agent_in_chan($nick, $cn)) {
agent_join($bot, $cn);
my $bot2 = { NICK => $nick, ID => ircd::getUuid($nick), UID=>ircd::getUuid($nick) };
+ if(!ircd::PREFIXAQ_DISABLE() && $IRCd_capabilities{"FOUNDER"} ne "" && $IRCd_capabilities{"ADMIN"} ne "") {
+ $botchmode = '+q';
+ } else {
+ $botchmode = '+o';
+ }
ircd::setmode($bot2, $cn, $botchmode, $bot2 );
}
}
push @out_cns, $cn;
}
- ircd::svsjoin(get_user_agent($user), get_user_nick($user), @out_cns) if scalar @out_cns;
+ ircd::svsjoin(get_user_agent($user), $user, @out_cns) if scalar @out_cns;
notice($user, @reply) if scalar @reply;
}
}
sub notify_auths($$) {
- my $user = @_;
- my $nick = get_user_nick ($user);
+ my ($user, $nick) = @_;
$get_num_nicktext_type->execute($nick, NTF_AUTH);
my ($count) = $get_num_nicktext_type->fetchrow_array(); $get_num_nicktext_type->finish();
notice($user, "$nick has $count channel authorizations awaiting action.",
my $nick = $user->{NICK};
get_lock($nick);
my $id = get_user_id($user);
+ print "DELETE: $nick, $id\n";
$del_nickchg_id->execute($id); $del_nickchg_id->finish();
$quit_update->execute($quit, $id); $quit_update->finish();
$update_lastseen->execute($id); $update_lastseen->finish();