summaryrefslogtreecommitdiff
path: root/scripts/mlock.pl
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-03-10 21:28:38 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-03-10 21:28:38 +0000
commit03c71116e044fda9d99e827a4ffb0652d508abb5 (patch)
treedf36506fb09ad6563feaf394a0a47728348cadd6 /scripts/mlock.pl
parent1855e6cc5c84ec861bf1301c09841cb2fd9ad718 (diff)
downloadirssi-03c71116e044fda9d99e827a4ffb0652d508abb5.zip
added/removed some default scripts
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2569 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'scripts/mlock.pl')
-rw-r--r--scripts/mlock.pl20
1 files changed, 18 insertions, 2 deletions
diff --git a/scripts/mlock.pl b/scripts/mlock.pl
index 35ad7856..bf2fd002 100644
--- a/scripts/mlock.pl
+++ b/scripts/mlock.pl
@@ -4,10 +4,21 @@
# Irssi will automatically change it back. +k and +l are a bit special since
# they require the parameter. If you omit the parameter, like setting the
# mode to "+ntlk", Irssi will allow all +k and +l (or -lk) mode changes.
+# You can remove the lock with /MODE #channel -
use Irssi;
use Irssi::Irc;
use strict;
+use vars qw($VERSION %IRSSI);
+
+$VERSION = "1.00";
+%IRSSI = (
+ authors => 'Timo Sirainen',
+ name => 'mlock',
+ description => 'Channel mode locking',
+ license => 'Public Domain',
+ changed => 'Sun Mar 10 23:18 EET 2002'
+);
my %keep_channels;
@@ -15,8 +26,13 @@ sub cmd_mlock {
my ($data, $server) = @_;
my ($channel, $mode) = split(/ /, $data, 2);
- $keep_channels{$channel} = $mode;
- mlock_check_mode($server, $channel);
+ if ($mode eq "-") {
+ # remove checking
+ delete $keep_channels{$channel};
+ } else {
+ $keep_channels{$channel} = $mode;
+ mlock_check_mode($server, $channel);
+ }
}
sub mlock_check_mode {