3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-01 17:16:39 +02:00

Allow unquiet from /msg

This commit is contained in:
Pragmatic Software 2010-04-03 19:49:41 +00:00
parent 0c54d9c93e
commit 73a12dc981
2 changed files with 13 additions and 5 deletions

View File

@ -79,17 +79,20 @@ sub unquiet {
return "";
}
if(not $from =~ /^#/) { #not a channel
return "/msg $nick This command must be used in the channel.";
my ($target, $channel) = split / /, $arguments;
if(not defined $target) {
return "/msg $nick Usage: unquiet <nick> [channel]";
}
if(not defined $arguments) {
return "/msg $nick Usage: unquiet nick";
}
$channel = $from if not defined $channel;
return "/msg $nick Unquiet must be used against a channel. Either use in channel, or specify !unquiet $target <channel>" if $channel !~ /^#/;
$self->{pbot}->chanops->unquiet_nick($arguments, $from);
delete ${ $self->{pbot}->chanops->{quieted_nicks} }{$arguments};
$self->{pbot}->conn->privmsg($arguments, "$nick has allowed you to speak again.") unless $arguments =~ /\Q$self->{pbot}->botnick\E/i;
return "Done.";
}
sub ban_user {

View File

@ -50,6 +50,9 @@ sub gain_ops {
if(not exists ${ $self->{is_opped} }{$channel}) {
$self->{pbot}->conn->privmsg("chanserv", "op $channel");
$self->{is_opped}->{$channel}{timeout} = gettimeofday + 300; # assume we're going to be opped
$self->{pbot}->{irc}->flush_output_queue();
$self->{pbot}->{irc}->do_one_loop();
} else {
$self->perform_op_commands();
}
@ -77,6 +80,8 @@ sub perform_op_commands {
}
shift(@{ $self->{op_commands} });
}
$self->{pbot}->{irc}->flush_output_queue();
$self->{pbot}->{irc}->do_one_loop();
$self->{pbot}->logger->log("Done.\n");
}