#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;
}
}
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
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');