diff options
author | Teddy Wing | 2018-02-14 22:06:57 +0100 |
---|---|---|
committer | Teddy Wing | 2018-02-14 22:06:57 +0100 |
commit | b8f971b65d1e3abc7a5734844f94367dfec3e67d (patch) | |
tree | b6b5bf53c869c86f166e677bee7a087ddf41bafe | |
parent | bf7216f3e55c357d1428f74a19fb34635452842c (diff) | |
download | irssi-dimpid-b8f971b65d1e3abc7a5734844f94367dfec3e67d.tar.bz2 |
Get rid of theme, use colour escape codes instead
After doing some research it seemed like it was going to be way too
complicated to do this with a theme.
I was able to print the message, but would need to include the whole
rest of the line, including timestamp, nick, etc. in order to make the
line look like it was a normal message. Too much work for not enough
gain. That's not to say it isn't possible. Here's the one script I found
that appeared to be doing this:
https://github.com/irssi/scripts.irssi.org/blob/d62bb05a34ffd6d8d0f719c551d8e454880ef8e1/scripts/nm2.pl
Crazy talented stuff.
Since we really just want to turn the message text grey, use a simple
`signal_continue` and colourise the text with escape codes.
-rw-r--r-- | dimpid.pl | 10 |
1 files changed, 2 insertions, 8 deletions
@@ -12,16 +12,10 @@ our %IRSSI = { }; -use Data::Dumper; - -Irssi::theme_register(['dimpid', '%5$0%n']); - Irssi::signal_add('message public', sub { - my ($server, $text, $nick, $address, $target) = @_; - - Irssi::print(Dumper($target), MSGLEVEL_CLIENTCRAP); + my ($server, $text, $nick, @rest) = @_; if ($nick eq 'test-3kj469y5h') { - $server->printformat($target, MSGLEVEL_PUBLIC, 'dimpid', $text); + Irssi::signal_continue($server, "\x{03}14" . $text . "\x{03}", $nick, @rest); } }); |