Commit Diff
Diff:
e112f2ae812467b89f1ff59bb00ee89bc15e25f9
edcb1b2b0cbd67fbcfcdf615e3ab137b1b702d8d
Commit:
edcb1b2b0cbd67fbcfcdf615e3ab137b1b702d8d
Tree:
9532623ad81d28b6393ccb2755fa9d60e2aafc43
Author:
jrmu <jrmu@ircnow.org>
Committer:
jrmu <jrmu@ircnow.org>
Date:
Sat May 6 05:44:50 2023 UTC
Message:
Check if accounts exists before approving, patch thanks to izzyb
blob - 461514fc5dc2a77ba272186f663be6b698eae990
blob + 167cd4f0a52817ac1a6ee54259ec974c9db93531
--- BNC.pm
+++ BNC.pm
@@ -121,9 +121,13 @@ sub mbnc {
return;
} elsif (main::isstaff($bot, $nick) && $text =~ /^approve\s+([[:ascii:]]+)/) {
my $username = $1;
- main::putserv($bot, "PRIVMSG *blockuser :unblock $username");
- foreach my $chan (@teamchans) {
+ if (SQLite::selectrows("bnc", "username", $username)) {
+ main::putserv($bot, "PRIVMSG *blockuser :unblock $username");
+ foreach my $chan (@teamchans) {
main::putserv($bot, "PRIVMSG $chan :$username bnc approved");
+ }
+ } else {
+ main::putserv($bot, "PRIVMSG $chan :$username hasn't requested a bnc account");
}
return;
} elsif ($staff =~ /$nick/ && $text =~ /^cloneuser$/i) {
IRCNow