From: phyber Date: Wed, 4 Mar 2009 19:13:12 +0000 (+0000) Subject: (quakequit) remove some commented code, fix up MIM processing. X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=b1ca74aee3cc0f8a55f74273aea57af3e124b011;p=irssi-scripts.irssi.org.git (quakequit) remove some commented code, fix up MIM processing. --- diff --git a/scripts/quakequit.pl b/scripts/quakequit.pl index 5b97493..1f8bf23 100644 --- a/scripts/quakequit.pl +++ b/scripts/quakequit.pl @@ -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');