All pastes #1336402 Raw Edit

TRUNCA1.PL

public text v1 · immutable
#1336402 ·published 2009-02-13 20:42 UTC
rendered paste body
# And that's what happens when someone does " /set completion_char -san: "

# Example input:   <grawity> Somerandomperson: Hi!
#         output:  <grawity> Somera~1: Hi!
use strict;
use warnings;
use Irssi;
use vars qw($VERSION %IRSSI);

$VERSION = "0.0.3";
%IRSSI = (
	name        => 'TRUNCA~1.PL',
	authors     => '<grawity@gmail.com>',
	license     => 'WTFPLv2'
);

sub message {
	my ($text, $server, $window) = @_;
	return unless ref $window;            # this one was just copypasted from something
	return unless $text =~ /^[^ ]+[:,] /; # dunno if this is needed
	$text =~ s/^([^:, ]{6})([^:, ]{3,})([:,].*)$/$1~1$3/;
	Irssi::signal_continue($text, $server, $window);	
}

Irssi::signal_add_first('send text', "message");