summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2000-12-06 05:42:13 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2000-12-06 05:42:13 +0000
commitd22ca4efe5261e81fc50e51cde03a75c6c43ab5c (patch)
tree8641961c49e7647a5c52cf90273aee1ee5e22d3a /scripts
parentbb594d2aa648619f02f04d8db0b7efffa24b9c77 (diff)
downloadirssi-d22ca4efe5261e81fc50e51cde03a75c6c43ab5c.zip
updated
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@976 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'scripts')
-rw-r--r--scripts/autoop.pl12
-rw-r--r--scripts/autorejoin.pl8
-rw-r--r--scripts/clones.pl5
-rw-r--r--scripts/hello.pl1
-rw-r--r--scripts/mlock.pl16
-rw-r--r--scripts/privmsg.pl5
-rw-r--r--scripts/quitmsg.pl2
-rw-r--r--scripts/realname.pl2
8 files changed, 24 insertions, 27 deletions
diff --git a/scripts/autoop.pl b/scripts/autoop.pl
index 5f36f798..2f119453 100644
--- a/scripts/autoop.pl
+++ b/scripts/autoop.pl
@@ -1,8 +1,6 @@
# /AUTOOP <*|#channel> [<nickmasks>]
-# For Irssi 0.7.96 and above
use Irssi;
-use Irssi::Irc;
my %opnicks, %temp_opped;
@@ -48,10 +46,10 @@ sub autoop {
my ($channel, $masks, @nicks) = @_;
my $server, $nickrec;
- $server = $channel->values()->{'server'};
+ $server = $channel->{server};
foreach $nickrec (@nicks) {
- $nick = $nickrec->values()->{'nick'};
- $host = $nickrec->values()->{'host'};
+ $nick = $nickrec->{nick};
+ $host = $nickrec->{host};
if (!$temp_opped{$nick} &&
$server->masks_match($masks, $nick, $host)) {
@@ -65,12 +63,12 @@ sub event_massjoin {
my ($channel, $nicks_list) = @_;
my @nicks = @{$nicks_list};
- return if (!$channel->values()->{'chanop'});
+ return if (!$channel->{chanop});
undef %temp_opped;
# channel specific
- my $masks = $opnicks{$channel->values()->{'name'}};
+ my $masks = $opnicks{$channel->{name}};
autoop($channel, $masks, @nicks) if ($masks);
# for all channels
diff --git a/scripts/autorejoin.pl b/scripts/autorejoin.pl
index 7954f121..75bac90d 100644
--- a/scripts/autorejoin.pl
+++ b/scripts/autorejoin.pl
@@ -8,15 +8,17 @@ use Irssi;
use Irssi::Irc;
sub event_rejoin_kick {
- my ($data, $server) = @_;
+ my ($server, $data) = @_;
my ($channel, $nick) = split(/ +/, $data);
- return if ($server->values()->{'nick'} ne $nick);
+ return if ($server->{nick} ne $nick);
# check if channel has password
$chanrec = $server->channel_find($channel);
- $password = $chanrec->values()->{'key'} if ($chanrec);
+ $password = $chanrec->{key} if ($chanrec);
+ # We have to use send_raw() because the channel record still
+ # exists and irssi won't even try to join to it with command()
$server->send_raw("JOIN $channel $password");
}
diff --git a/scripts/clones.pl b/scripts/clones.pl
index a562b968..5a0c61a2 100644
--- a/scripts/clones.pl
+++ b/scripts/clones.pl
@@ -1,16 +1,15 @@
# /CLONES - display real name of nick
use Irssi;
-use Irssi::Irc;
sub cmd_clones {
my ($data, $server, $channel) = @_;
my %hostnames, $host, @nicks, $nick;
- @nicks = $channel->nicklist_getnicks();
+ @nicks = $channel->nicks();
foreach $nick (@nicks) {
- $hostnames{$nick->values()->{'host'}}++;
+ $hostnames{$nick->{host}}++;
}
$channel->print("Clones:");
diff --git a/scripts/hello.pl b/scripts/hello.pl
index b08a84b1..de53c3ab 100644
--- a/scripts/hello.pl
+++ b/scripts/hello.pl
@@ -1,7 +1,6 @@
# "Hello, world!" script :) /hello <nick> sends "Hello, world!" to <nick>
use Irssi;
-use Irssi::Irc;
sub cmd_hello {
my ($data, $server, $channel) = @_;
diff --git a/scripts/mlock.pl b/scripts/mlock.pl
index 01d08b45..5bc0bde7 100644
--- a/scripts/mlock.pl
+++ b/scripts/mlock.pl
@@ -1,4 +1,4 @@
-# /MLOCK <channel> <mode> - for Irssi 0.7.96 and above
+# /MLOCK <channel> <mode>
#
# Locks the channel mode to <mode>, if someone else tries to change the mode
# Irssi will automatically change it back. +k and +l are a bit special since
@@ -21,16 +21,16 @@ sub mlock_check_mode {
my ($server, $channame) = @_;
$channel = $server->channel_find($channame);
- return if (!channel || !$channel->values()->{'chanop'});
+ return if (!channel || !$channel->{chanop});
$keep_mode = $keep_channels{$channame};
return if (!$keep_mode);
# old channel mode
- $oldmode = $channel->values()->{'mode'};
+ $oldmode = $channel->{mode};
$oldmode =~ s/^([^ ]*).*/\1/;
- $oldkey = $channel->values()->{'key'};
- $oldlimit = $channel->values()->{'limit'};
+ $oldkey = $channel->{key};
+ $oldlimit = $channel->{limit};
# get the new channel key/limit
@newmodes = split(/ /, $keep_mode); $keep_mode = $newmodes[0];
@@ -93,12 +93,12 @@ sub mlock_check_mode {
}
if ($modecmd ne "") {
- $channel->values()->{'server'}->command("/mode $channame $modecmd$extracmd");
+ $channel->{server}->command("/mode $channame $modecmd$extracmd");
}
}
sub mlock_mode_changed {
- my ($data, $server) = @_;
+ my ($server, $data) = @_;
my ($channel, $mode) = split(/ /, $data, 2);
mlock_check_mode($server, $channel);
@@ -107,7 +107,7 @@ sub mlock_mode_changed {
sub mlock_synced {
my $channel = $_[0];
- mlock_check_mode($channel->values()->{'server'}, $channel->values()->{'name'});
+ mlock_check_mode($channel->{server}, $channel->{name});
}
Irssi::command_bind('mlock', '', 'cmd_mlock');
diff --git a/scripts/privmsg.pl b/scripts/privmsg.pl
index 9fdcdcb1..c667220c 100644
--- a/scripts/privmsg.pl
+++ b/scripts/privmsg.pl
@@ -1,15 +1,14 @@
# listen PRIVMSGs - send a notice to yourself when your nick is meantioned
use Irssi;
-use Irssi::Irc;
sub event_privmsg {
- my ($data, $server, $nick, $address) = @_;
+ my ($server, $data, $nick, $address) = @_;
my ($target, $text) = $data =~ /^(\S*)\s:(.*)/;
return if (!$server->ischannel($target));
- $mynick = $server->values()->{'nick'};
+ $mynick = $server->{nick};
return if ($text !~ /\b$mynick\b/);
$server->command("/notice $mynick In channel $target, $nick!$address said: $text");
diff --git a/scripts/quitmsg.pl b/scripts/quitmsg.pl
index 3d8ce289..46e45ffd 100644
--- a/scripts/quitmsg.pl
+++ b/scripts/quitmsg.pl
@@ -25,7 +25,7 @@ sub cmd_quit {
@servers = Irssi::servers;
foreach $server (@servers) {
- $server->command("/disconnect ".$server->values()->{'tag'}." $quitmsg");
+ $server->command("/disconnect ".$server->{tag}." $quitmsg");
}
}
diff --git a/scripts/realname.pl b/scripts/realname.pl
index 1b48f044..d57de3d2 100644
--- a/scripts/realname.pl
+++ b/scripts/realname.pl
@@ -24,7 +24,7 @@ sub cmd_realname {
}
sub event_rn_whois {
- my ($num, $nick, $user, $host, $empty, $realname) = split(/ +/, $_[0], 6);
+ my ($num, $nick, $user, $host, $empty, $realname) = split(/ +/, $_[1], 6);
$realname =~ s/^://;
Irssi::print("%_$nick%_ is $realname");