]> git.99rst.org Git - irssi-scripts.irssi.org.git/commitdiff
bansearch: various fixes and improvements
authorDoug Freed <redacted>
Fri, 21 Aug 2020 16:25:18 +0000 (16:25 +0000)
committerDoug Freed <redacted>
Fri, 21 Aug 2020 16:32:37 +0000 (16:32 +0000)
* Adjust set-by-server check to not be freenode-specific
* Make $~a check work
* Add $a check
* Make $x check work for all cases

scripts/bansearch.pl

index df547180c1750c4213026ee75ac999248bef5dbb..49fd606a27196cb44a4214d84bb72726401f7ee9 100644 (file)
@@ -5,7 +5,7 @@ use Irssi;
 use Irssi::Irc;
 use vars qw($VERSION %IRSSI);
 
-$VERSION = "1.2";
+$VERSION = "1.3";
 %IRSSI = (
     authors     => 'Nathan Handler, Joseph Price',
     contact     => 'nathan.handler@gmail.com, pricechild@ubuntu.com',
@@ -106,7 +106,7 @@ sub RPL_BANLIST {
     $maskreg=~s/\*/\.\*\?/g;
 
     #We only want to display who set the ban/quiet if it is listed as a person
-    if($setby=~m/^.*?\.freenode\.net$/i) {
+    if($setby=~m/^[^!.]+\.[^!]+$/i) {
        $setby='';
     }
     else {
@@ -138,6 +138,17 @@ sub RPL_BANLIST {
        }
        # any logged-in user
        if($maskreg=~m/^\$a$/i) {
+           if($account!~m/^0$/) {
+               Irssi::active_win()->print(
+                   "$type against \x02$mask\x02 in $banchannel matches identified user." . $setby);
+               $issues++;
+           }
+           else {
+#              Irssi::active_win()->print("$type against \x02$mask\x02 does NOT match $account" . $setby);
+           }
+       }
+       # any unidentified user
+       if($maskreg=~m/^\$\~a$/i) {
            if($account=~m/^0$/) {
                Irssi::active_win()->print(
                    "$type against \x02$mask\x02 in $banchannel matches unidentified user." . $setby);
@@ -160,7 +171,7 @@ sub RPL_BANLIST {
        }
        # full match
        if($maskreg=~m/^\$x:(.*?)$/i) {
-           my $full = "$nick!user\@host\#$real";
+           my $full = "$nick!$user\@$host\#$real";
            if($full=~m/^$1$/i) {
                Irssi::active_win()->print(
                    "$type against \x02$mask\x02 in $banchannel matches $full" . $setby);
git clone https://git.99rst.org/PROJECT