#What we care about: CHANMODES :admin=&a founder=~q Determines if we can set +a and +q on people, halfop %h: likewise... cloak=x determines if we can have cloaks or vhosts. in the modules we care about chghost, chgident, cloaking for vhosts, m_silence and m_watch for silence and watch respectively. Also c_registered, we can _NOT_ continue w/o it.
#I HAVE NO IDEA where to get the watch/silence list limit!!!
#let's do this the lame way!
-#FIXME this is so ugly
+ #FIXME this is so ugly
my $capab = $_[0];
print "CAPAB $_[0]\n";
$capab =~ /CAPAB (\S+)/;
if ($capab =~ /registered/) {
$IRCd_capabilities{"REG"} = 1;
}
+ $IRCd_capabilities {"INSP"} = 1; #this is _horrible_
}
sub STATS($) {
sub setmode($$$;$) {
my ($src, $dst, $modes, $target) = @_;
my $srcId;
- print "IRCD::SETMODE\n";
- print Dumper ($src);
- print Dumper ($target);
if (initial_synced()) {
if (ref($src) eq "HASH") {
$srcId = ($src->{ID}?$src->{ID}:($src->{UUID}?$src->{UUID}:$src->{NICK}));
}
my $targetId;
if (ref ($target) eq "HASH") {
- $targetId = ($target->{UID}?$target->{UID}:($target->{ID}?$target->{ID}:$target->{NICK}));
+ $targetId = ($target->{UID}?$target->{UID}:($target->{ID}?encodeUUID($target->{ID}):$target->{NICK}));
}
else {
$targetId = $target;
}
callfuncs('MODE', undef, 1, [$srcId, $dst, $modes, $targetId]);
- print "$ircline -- setmode($srcId, $dst, $modes, $targetId)\n" ;
+ print "$ircline -- setmode($srcId, $dst, $modes, $targetId)\n" if DEBUG;
ircsend(":$srcId MODE $dst $modes $targetId");
}
my ($key, $value) = split('=', $token);
$IRCd_capabilities{$key} = ($value ? $value : 1);
}
- #for insp... unreal supports it anyway
+ # Insp compatibility... :(
$IRCd_capabilities{"CHGHOST"} = 1;
$IRCd_capabilities{"CHGIDENT"} = 1;
$IRCd_capabilities{"CLOAKHOST"} = 1;
$IRCd_capabilities{"SILENCE"} = 32;
$IRCd_capabilities{"WATCH"} = 32;
$IRCd_capabilities{"REG"} = 1;
+ $IRCd_capabilities{"INSP"} = 0;
+ # so ugly. Ugly Ugly UGLY.
}
sub STATS($) {
unless(is_agent_in_chan($nick, $cn)) {
agent_join($bot, $cn);
my $bot2 = { NICK => $nick, ID => ircd::getUuid($nick), UID=>ircd::getUuid($nick) };
- print Dumper ($botchmode);
- print Dumper ($bot);
- ircd::setmode($bot, $cn, $botchmode, $bot );
+ ircd::setmode($bot2, $cn, $botchmode, $bot2 );
}
}
if($mode eq '-') { $sign = 0; next; }
my $arg = shift(@args) if($mode =~ $scm or $mode =~ $ocm);
- my $auser = { ID => $arg };
-
+ my $auser;
+ if ($IRCd_capabilities {"INSP"} == 1) { #FIXME this is awful
+ $auser = { ID => $arg };
+ }
+ else {
+ $auser = { NICK => $arg };
+ }
if($mode =~ /^[vhoaq]$/) {
next if $arg eq '';
next if is_agent($arg);