]> git.99rst.org Git - irssi-scripts.irssi.org.git/commitdiff
(quakequit) remove some commented code, fix up MIM processing.
authorphyber <redacted>
Wed, 4 Mar 2009 19:13:12 +0000 (19:13 +0000)
committerbw1 <redacted>
Sun, 14 Jan 2018 21:00:15 +0000 (22:00 +0100)
scripts/quakequit.pl

index 5b974937611ae9bd6089b681eecb53ad651a9880..1f8bf2332d1b3501171bb17ceefd646f4a9608de 100644 (file)
@@ -45,7 +45,6 @@ sub message_join {
        #Irssi::print "Processing JOIN $tag: $nick $addr";
        # If the joining nick is in our quit hash, don't show the join.
        if ($quits{$nick} == 1) {
-               #delete $quits{$nick};
                Irssi::signal_stop();
                return 0;
        }
@@ -79,38 +78,20 @@ sub message_irc_mode {
        }
        Irssi::print "Processing MIM $tag: $channel $nick $addr $mode";
        my $servermask = Irssi::settings_get_str('quakequit_servermask');
-       # break the target nicks away from the modes set on them.
-       my ($modes, @targets) = split / /, $mode, 2;
-       # If the nick exists in the hash and the mode setter is *.quakenet.org, signal_stop.
-       foreach my $target (@targets) {
-               if ($quits{$target} == 1) {
-                       Irssi::signal_stop();
-                       return 0;
+       # If the server is setting the mode, the $nick will be the server mask and $addr will be empty.
+       if ($nick eq $servermask) {
+               # break the target nicks away from the modes set on them.
+               my ($modes, @targets) = split / /, $mode, 2;
+               # If the nick exists in the hash and the mode setter is *.quakenet.org, signal_stop.
+               foreach my $target (@targets) {
+                       if ($quits{$target} == 1) {
+                               Irssi::signal_stop();
+                               return 0;
+                       }
                }
        }
 }
 
-#sub nick_mode_changed {
-#      my ($channel_rec, $nick_rec, $setby, $mode, $type) = @_;
-#      my $tag = $channel_rec->{server}->{tag};
-#      # Return if we don't care about this tag
-#      if (process_tag($tag) == 0) {
-#              return 0;
-#      }
-#      my $nick = $nick_rec->{nick};
-#      my $servermask = Irssi::settings_get_str('quakequit_servermask');
-#      Irssi::print "Processing MODE $tag: $nick $setby $mode $type";
-#      # If the nick exists in the hash and the mode setter is *.quakenet.org, signal_stop.
-#      #if (($quits{$nick} == 1) and (lc $setby eq lc $servermask)) {
-#      if ($quits{$nick} == 1) {
-#              if ($setby eq $servermask) {
-#                      print "Setby is matching quakenet.org";
-#              }
-#              Irssi::signal_stop();
-#              return 0;
-#      }
-#}
-
 ## Settings
 # quakequit_networks: set the networks that you'd like this script to watch
 # quakequit_servermask: the name of the server that's setting the modes on rejoin
@@ -120,4 +101,3 @@ Irssi::settings_add_str('quakequit', 'quakequit_servermask', '*.quakenet.org');
 Irssi::signal_add_last('message irc mode', 'message_irc_mode');
 Irssi::signal_add_last('message join', 'message_join');
 Irssi::signal_add_last('message quit', 'message_quit');
-#Irssi::signal_add('nick mode changed', 'nick_mode_changed');
git clone https://git.99rst.org/PROJECT