# And that's what happens when someone does " /set completion_char -san: " # Example input: Somerandomperson: Hi! # output: Somera~1: Hi! use strict; use warnings; use Irssi; use vars qw($VERSION %IRSSI); $VERSION = "0.0.3"; %IRSSI = ( name => 'TRUNCA~1.PL', authors => '', 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");