use strict;
use warnings;
-our $VERSION = '0.3';
+our $VERSION = '0.4';
our %IRSSI = (
- authors => 'Lars Djerf, Nei, Phoenix616',
- contact => 'lars.djerf@gmail.com, Nei @ anti@conference.jabber.teamidiot.de, Phoenix616 @ mail@moep.tv',
+ authors => 'Lars Djerf, Nei, Phoenix616, Rhonda D\'Vine',
+ contact => 'lars.djerf@gmail.com, Nei @ anti@conference.jabber.teamidiot.de, Phoenix616 @ mail@moep.tv, rhonda @ deb.at',
name => 'colon_emoji',
description => 'Replace words between :...: in messages according to a text file. Was intended for Unicode Emoji on certain proprietary platforms.',
license => 'GPLv3',
# Changelog
# =========
# 0.2: Handle outgoing messages
+# 0.3: ???
+# 0.4: tab completion added
#
use File::Basename 'dirname';
}
}
+sub sig_complete {
+ my ($list, $window, $word, $linestart, $want_space) = @_;
+ return unless $word =~ /^:/i;
+ my @newlist;
+ my ($str) = $word =~ /^:(.*):?$/;
+ foreach (keys %emojie) {
+ push @newlist, $emojie{$_} if /^(\Q$str\E.*)$/;
+ }
+ push @$list, $_ foreach @newlist;
+ Irssi::signal_stop();
+}
+
sub event_message {
my ($server, $msg, @rest) = @_;
$msg =~ s/$regex/$emojie{$1}/g;
Irssi::signal_add_first('message private' => 'sig_message_private');
Irssi::signal_add_first('send command' => 'sig_send');
Irssi::signal_add_first('send text' => 'sig_send');
+Irssi::signal_add_first('complete word', 'sig_complete');
init();