Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use Irssi;
- use POSIX;
- use vars qw($VERSION %IRSSI);
- $VERSION = "0.3";
- %IRSSI = (
- authors => "Tony Bruess",
- contact => "tony@oc.tc",
- name => "lognotice",
- description => "Print hilighted messages to the console",
- changed => "July 1 2011"
- );
- sub sig_printtext {
- my ($dest, $text, $stripped) = @_;
- my $opt = MSGLEVEL_HILIGHT;
- if(Irssi::settings_get_bool('lognotice_showprivmsg')) {
- $opt = MSGLEVEL_HILIGHT|MSGLEVEL_MSGS;
- }
- if(($dest->{level} & ($opt)) && ($dest->{level} & MSGLEVEL_NOHILIGHT) == 0) {
- $window = Irssi::window_find_refnum('1');
- if($dest->{level} & MSGLEVEL_PUBLIC) {
- $text = $dest->{target} . ": ". $text;
- }
- $text = strftime(Irssi::settings_get_str('timestamp_format') . " ", localtime) . $text;
- $window->print($text, MSGLEVEL_NEVER) if ($window);
- }
- }
- $window = Irssi::window_find_refnum('1');
- Irssi::print("Error! Cannot find console window") if (!$window);
- Irssi::settings_add_bool('lognotice','lognotice_showprivmsg', 0);
- Irssi::signal_add('print text', 'sig_printtext');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement