2

I want to /ignore a nick and still have their messages appear in my logs. Specifically, I don't want to know that they are talking in channel generally, but want the ability to look through logs to get the full context if I'm following a conversation which does not make much sense.

I don't want this badly enough to learn to write a new script, but am capable and willing to modify an existing script which does close to what I want it to do if it exists.

1 Answers1

2

Was looking for something similar found this,

https://github.com/irssi/scripts.irssi.org/blob/master/scripts/ignore_log.pl

The script will log anything that is set to be ignored.

In case the link goes down, it is referred through https://scripts.irssi.org, and here are the current contents:

#!/usr/bin/perl

# ignore_log.pl (ignore_log -- send [some] ignored events to log), Version 0.1
# this script is dedicated to bormann@IRCNET.
#
# Copyleft (>) 2004 jsn <jason@nichego.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# The complete text of the GNU General Public License can be found
# on the World Wide Web: <URL:http://www.gnu.org/licenses/gpl.html>

use strict;
use Irssi;

use POSIX qw/strftime/ ;

use vars qw($VERSION %IRSSI);

$VERSION = "0.1";
%IRSSI = (
    authors     => 'Dmitry "jsn" Kim',
    contact     => 'jason@nichego.net',
    name        => 'ignore_log',
    description => 'script to log ignored messages',
    license     => 'GPL',
    url     => 'http://',
    changed     => '2004-09-10',
    changes     => 'initial version'
);

Irssi::print("*****\n* $IRSSI{name} $VERSION loaded.");
Irssi::print("*  use `/set ignore_log <filename>' to configure") ;
Irssi::print("*  use `/set ignore_log none' to disable ignore logging") ;

sub handle_public {
    my  ($srv, $msg, $nick, $addr, $tgt) = @_;
    return if lc(Irssi::settings_get_str("ignore_log")) eq "none" ;
    write_log($nick, $msg, $tgt)
        if $srv->ignore_check($nick, $addr, $tgt, $msg, MSGLEVEL_PUBLIC) ;
}

sub handle_private {
    my  ($srv, $msg, $nick, $addr) = @_;
    return if lc(Irssi::settings_get_str("ignore_log")) eq "none" ;
    write_log($nick, $msg)
        if $srv->ignore_check($nick, $addr, "", $msg, MSGLEVEL_MSGS) ;
}

sub write_log {
        my  ($nick, $msg, $tgt) = @_ ;
    $tgt ||= "->" ;
    my  ($lfile) = glob Irssi::settings_get_str("ignore_log");
    if (open(LF, ">>", $lfile)) {
        my  $ts = strftime("%D %H:%M", localtime()) ;
        print LF "[$ts] $tgt $nick $msg\n" ;
        close LF ;
    } else {
        Irssi::active_win()->print("can't open file `$lfile': $!") ;
    }
}

Irssi::settings_add_str("ignore_log", "ignore_log", "~/.irssi/ignore.log");

Irssi::print("*  logging ignored users to `" .
    Irssi::settings_get_str("ignore_log") . "'") ;

Irssi::signal_add_first("message public", "handle_public") ;
Irssi::signal_add_first("message private", "handle_private") ;
eis
  • 2,069