op => sub { my ($priv_conn, $from, $userhost) = (shift, shift, shift); my $userpass = shift; my $op_chan = to_channel(shift); my $nicks=join(' ', @_); my $ops="+o" x scalar @_; notify_users($priv_conn, 'op', "$from requested OP on $op_chan \"" . join(' ', @_)) . "\""; if(host_to_user($userhost) && host_to_user($userhost)->{flags} =~ /w/) { if ($userpass eq host_to_user($userhost)->{password}) { $priv_conn->mode($op_chan, "$ops $nicks"); } else { $priv_conn->privmsg($from, "Password $userpass incorrect. " . host_to_user($userhost)->{password}); } } }, deop => sub { my ($priv_conn, $from, $userhost) = (shift, shift, shift); my $userpass = shift; my $op_chan = to_channel(shift); my $nicks = join(' ', @_); my $ops = "-o" x scalar @_; notify_users($priv_conn, 'op', "$from requested DEOP on $op_chan \"" . join(' ', @_)) . "\""; if(host_to_user($userhost) && host_to_user($userhost)->{flags} =~ /w/ ) { if ($userpass eq host_to_user($userhost)->{password}) { $priv_conn->mode($op_chan, "$ops $nicks"); } else { $priv_conn->privmsg($from, "You are not an owner."); } } },
Log in to post a comment.
op => sub {
my ($priv_conn, $from, $userhost) = (shift, shift, shift);
my $userpass = shift;
my $op_chan = to_channel(shift);
my $nicks=join(' ', @_);
my $ops="+o" x scalar @_;
notify_users($priv_conn, 'op', "$from requested OP on $op_chan \"" . join(' ', @_)) . "\"";
if(host_to_user($userhost) && host_to_user($userhost)->{flags} =~ /w/) {
if ($userpass eq host_to_user($userhost)->{password}) {
$priv_conn->mode($op_chan, "$ops $nicks");
} else {
$priv_conn->privmsg($from, "Password $userpass incorrect. " . host_to_user($userhost)->{password});
}
}
},
deop => sub {
my ($priv_conn, $from, $userhost) = (shift, shift, shift);
my $userpass = shift;
my $op_chan = to_channel(shift);
my $nicks = join(' ', @_);
my $ops = "-o" x scalar @_;
notify_users($priv_conn, 'op', "$from requested DEOP on $op_chan \"" . join(' ', @_)) . "\"";
if(host_to_user($userhost) && host_to_user($userhost)->{flags} =~ /w/ ) {
if ($userpass eq host_to_user($userhost)->{password})
{
$priv_conn->mode($op_chan, "$ops $nicks");
} else {
$priv_conn->privmsg($from, "You are not an owner.");
}
}
},