summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-03-11 04:21:01 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-03-11 04:21:01 +0000
commit1ec1cb83829564565de2024d4359bd7319dc1099 (patch)
tree9e50c6609969d37fd9d34e3dd3025c849e5e6a31 /scripts
parent8fa39c23a700da647eb22be83b74780e01150799 (diff)
downloadirssi-1ec1cb83829564565de2024d4359bd7319dc1099.zip
updated
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2577 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'scripts')
-rw-r--r--scripts/splitlong.pl12
1 files changed, 7 insertions, 5 deletions
diff --git a/scripts/splitlong.pl b/scripts/splitlong.pl
index ee787ed9..0df23426 100644
--- a/scripts/splitlong.pl
+++ b/scripts/splitlong.pl
@@ -7,25 +7,27 @@ use vars qw($VERSION %IRSSI);
#don't know which version exactly, probably even works with 0.7.98.4
use Irssi 20011001;
-$VERSION = "0.15";
+$VERSION = "0.17";
%IRSSI = (
authors => "Bjoern \'fuchs\' Krombholz",
contact => "bjkro\@gmx.de",
name => "splitlong",
+ licence => "Public Domain",
description => "Split overlong PRIVMSGs to msgs with length allowed by ircd",
- changed => "Fri Jan 25 07:18:48 CET 2002"
+ changed => "Wed Mar 8 03:03:10 CET 2002",
+ changes => "fixed some strange bug, depends on new switches to msg command (-nick|-channel)"
);
sub sig_command_msg {
my ($cmd, $server, $winitem, $TEST) = @_;
- my ($target, $data) = $cmd =~ /^(\S*)\s(.*)/;
+ my ($type, $target, $data) = $cmd =~ /^(\S*)\s(\S*)\s(.*)/;
my $maxlength = Irssi::settings_get_int('splitlong_max_length');
if ($maxlength == 0) {
# 497 = 510 - length(":" . "!" . " PRIVMSG " . " :");
$maxlength = 497 - length($server->{nick} . $server->{userhost} . $target);
}
- my $maxlength2 = $maxlength + length("... ");
+ my $maxlength2 = $maxlength - length("... ");
if (length($data) > ($maxlength)) {
my @spltarr;
@@ -39,7 +41,7 @@ sub sig_command_msg {
push @spltarr, $data;
foreach (@spltarr) {
- Irssi::signal_emit("command msg", "$target $_", $server, $winitem);
+ Irssi::signal_emit("command msg", "$type $target $_", $server, $winitem);
}
Irssi::signal_stop();
}