1
0
Fork 0
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@768 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2000-10-18 20:50:12 +00:00 committed by cras
parent ac6bfeba1f
commit fcb1374e40
10 changed files with 94 additions and 8 deletions

View File

@ -1,7 +1,8 @@
# /AUTOOP <*|#channel> [<nickmasks>]
# For Irssi 0.7.96 and above (older versions had a few bugs)
# For Irssi 0.7.96 and above
use Irssi;
use Irssi::Irc;
my %opnicks, %temp_opped;
@ -45,14 +46,15 @@ sub cmd_autoop {
sub autoop {
my ($channel, $masks, @nicks) = @_;
my $nickrec;
my $server, $nickrec;
$server = $channel->values()->{'server'};
foreach $nickrec (@nicks) {
$nick = $nickrec->values()->{'nick'};
$host = $nickrec->values()->{'host'};
if (!$temp_opped{$nick} &&
Irssi::irc_masks_match($masks, $nick, $host)) {
$server->masks_match($masks, $nick, $host)) {
$channel->command("/op $nick");
$temp_opped{$nick} = 1;
}
@ -60,7 +62,8 @@ sub autoop {
}
sub event_massjoin {
my ($channel, @nicks) = @_;
my ($channel, $nicks_list) = @_;
my @nicks = @{$nicks_list};
return if (!$channel->values()->{'chanop'});

View File

@ -5,6 +5,7 @@
# if you kick/get kicked all the time "just for fun" ...
use Irssi;
use Irssi::Irc;
sub event_rejoin_kick {
my ($data, $server) = @_;

View File

@ -1,6 +1,7 @@
# "Hello, world!" script :) /hello <nick> sends "Hello, world!" to <nick>
use Irssi;
use Irssi::Irc;
sub cmd_hello {
my ($data, $server, $channel) = @_;

View File

@ -1,4 +1,4 @@
# /MLOCK <channel> <mode> - for Irssi 0.7.29 and above
# /MLOCK <channel> <mode> - for Irssi 0.7.96 and above
#
# 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
@ -6,6 +6,7 @@
# mode to "+ntlk", Irssi will allow all +k and +l (or -lk) mode changes.
use Irssi;
use Irssi::Irc;
sub cmd_mlock {
my ($data, $server) = @_;
@ -26,7 +27,7 @@ sub mlock_check_mode {
return if (!$keep_mode);
# old channel mode
$oldmode = $channel->get_mode();
$oldmode = $channel->values()->{'mode'};
$oldmode =~ s/^([^ ]*).*/\1/;
$oldkey = $channel->values()->{'key'};
$oldlimit = $channel->values()->{'limit'};

View File

@ -1,12 +1,13 @@
# 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 ($target, $text) = $data =~ /^(\S*)\s:(.*)/;
return if (!Irssi::is_channel($target));
return if (!$server->ischannel($target));
$mynick = $server->values()->{'nick'};
return if ($text !~ /\b$mynick\b/);

View File

@ -1,6 +1,7 @@
# Quit with a random quit message read from ~/.irssi/irssi.quit
use Irssi;
use Irssi::Irc;
$quitfile = "$ENV{HOME}/.irssi/irssi.quit";

View File

@ -1,6 +1,7 @@
# /RN - display real name of nick
use Irssi;
use Irssi::Irc;
sub cmd_realname {
my ($data, $server, $channel) = @_;

View File

@ -101,6 +101,48 @@ CODE:
(char *) SvPV(ST(n), n_a), (char *) SvPV(ST(n+1), n_a), (int) SvIV(ST(n+2)));
}
void
channels_join(server, data, automatic)
Irssi::Server server
char *data
int automatic
CODE:
server->channels_join(server, data, automatic);
int
isnickflag(server, flag)
Irssi::Server server
char flag
CODE:
RETVAL = server->isnickflag(flag);
OUTPUT:
RETVAL
int
ischannel(server, flag)
Irssi::Server server
char flag
CODE:
RETVAL = server->ischannel(flag);
OUTPUT:
RETVAL
char *
get_nick_flags(server)
Irssi::Server server
CODE:
RETVAL = (char *) server->get_nick_flags();
OUTPUT:
RETVAL
void
send_message(server, target, msg)
Irssi::Server server
char *target
char *msg
CODE:
server->send_message(server, target, msg);
#*******************************
MODULE = Irssi PACKAGE = Irssi::Connect PREFIX = server_
#*******************************

View File

@ -52,7 +52,7 @@ CODE:
signal_emit("send command", 3, cmd, server, item);
void
printtext(server, channel, level, str)
printtext(server, channel, str, level)
Irssi::Server server
char *channel
int level
@ -141,3 +141,15 @@ command(item, cmd)
char *cmd
CODE:
signal_emit("send command", 3, cmd, item->server, item);
#*******************************
MODULE = Irssi PACKAGE = Irssi::Channel
#*******************************
void
print(channel, str, level=MSGLEVEL_CLIENTNOTICE)
Irssi::Channel channel
int level
char *str
CODE:
printtext(channel->server, channel->name, level, str);

View File

@ -18,6 +18,29 @@ char *
irc_server_get_channels(server)
Irssi::Irc::Server server
void
send_raw(server, cmd)
Irssi::Irc::Server server
char *cmd
CODE:
irc_send_cmd(server, cmd);
void
send_raw_now(server, cmd)
Irssi::Irc::Server server
char *cmd
CODE:
irc_send_cmd_now(server, cmd);
void
send_raw_split(server, cmd, nickarg, max_nicks)
Irssi::Irc::Server server
char *cmd
int nickarg
int max_nicks
CODE:
irc_send_cmd_split(server, cmd, nickarg, max_nicks);
MODULE = Irssi::Irc PACKAGE = Irssi::Irc::Connect PREFIX = irc_server_
void