Image of the glider from the Game of Life by John Conway
Skip to content

Irssi Handling JOINS/PARTS/QUITS

Irssi, as blogged extensively throughout this site, is one solid client. The flexibility never ceases to amaze me, and tonight was one of those times.

Hanging out in the amount of channels I do, I see a lot of activity in my statusbar for all of my joined channels. This can be overwhelming for some, but I don't mind it. What I do mind, however, is when I check in on a specific channel, and see pages and pages of scrollback that is nothing more than people joining and leaving the channel. I've tried blatantly ignoring JOINS, PARTS and QUITS, as they're called, but I always disable it, because I usually want to be kept abreast of when someone leaves a channel that I'm having a conversation with. I don't want to look silly continuing to chat to someone, long after they've left. So, I need a way to keep on top of when people are joining and leaving the channel, but not have that information in the channel itself. Thankfully, Irssi meets this need.

The concept is simple. A JOIN, PART or QUIT is what is referred to as a "level". There are a number of different levels that Irssi supports, all of which can be found with "/help levels" in Irssi. With Irssi, it is possible to ignore, or even redirect, levels. In my case, I want to redirect these three levels to another window, if possible. So, digging through the settings in Irssi, I found "window_check_level_first". By default, this setting is "OFF", which means that Irssi has a global setting for levels, and how they're handled. Enabling this setting, means to follow the levels that have been assigned to their respective channels. However, if you turn this on first, without doing some initial setup before hand, you'll notice everything going to your status window by default, including chat. This isn't what we want, so let's get setup.

The first thing we need to do is set our levels for all of our currently open windows, as well as any future windows that we open. We can accomplish this with two commands in Irssi:

/foreach window /window level ALL -JOINS -PARTS -QUITS
/set window_default ALL -JOINS -PARTS -QUITS

Now, the next thing to do is to create a new hidden window that will be the new home for all your JOINS, PARTS and QUITS. So, from Irssi:

/window new HIDDEN

Navigate to that window, wherever it is placed, and give it a name. For me, I called it "junk". Of course, this isn't necessary, just optional, but I prefer that each of my windows have a name:

/window name junk

It will have picked up the -JOINS -PARTS -QUITS from our default setting we just applied, so we'll need to reverse that. Easiest way is to just apply the converse of what you did earlier:

/window level -ALL JOINS PARTS QUITS

Sweet. Our window is finished. Now, we can turn on the setting that will tell Irssi to look for each individual window level setting:

/set window_check_level_first ON

Wait a bit, and you should see all the JOINS, PARTS and QUITS going to your new hidden window, rather than each respective channel. You'll also notice that it doesn't print the channel where these are originating. I don't know of an easy way to set that without a script, so if you know of such a script that exists, or want to write one yourself, sharing that would be appreciated. In the meantime, this is better than nothing.

Don't forget to save:

/save

Also, you may not want to make your "junk" window hidden, but rather make it sticky, and split Irssi, putting the junk window on the top. I've done this with my highlight window, so it would make sense here. In that case, just:

/window stick on
/window show (number|name)

You can then size the window as needed if you decide you split your Irssi.

And, there you have it. Now, when people are joining and quitting, rather than filling your scrollback where precious chat exists, it's all being forwarded to a window of your choice. If eventually, you like this setup, and you find that you're not checking your junk window for joins and quits, then you may be able to get away with just ignoring JOINS, PARTS and QUITS altogether Irssi-wide. Which means, if for any reason you want to reverse this setup, it's rather trivial:

/set window_check_level_first OFF
/foreach window /window level ALL
/set window_default_level ALL
/window close
/save

And that would back you out of this configuration, and get you back to default.

I should mention that I've heard that WeeChat has a feature that only people you've recently chatted with will show when they quit, or there is a setting for setting this. I personally think WeeChat is a solid client. However, in this case, I don't want to see any quits, even with those I'm chatting with, in that buffer. However, I would like to see it in another buffer, and Irssi makes this painless. So, while I'm sure WeeChat can also meet similar needs, Irssi meets my needs best.

As with my other Irssi tutorials, I hope this one was helpful. I find that I personally benefit from my own writing, and that's the major reason why I blog. I have searched for doing solving problems in the past, only to stumble upon my own blog post, outlining the very issue I'm faced with again. So, if it won't benefit you, at least it will benefit myself.

{ 7 } Comments

  1. Daniel Lange using Firefox 3.5.8 on Ubuntu 64 bits | March 13, 2010 at 2:48 am | Permalink

    With my irssi (v0.8.14) it's /set window_check_level_first ON (levelcheck exchanged).
    Quits are not channel bound as you do not quit a channel but the whole server, same for nick changes.
    The patch for http://bugs.irssi.org/index.php?do=details&task_id=204&project=5 also has a more general solution that may be of interest.

  2. Aaron using Google Chrome 5.0.342.1 on GNU/Linux 64 bits | March 13, 2010 at 7:46 am | Permalink

    @Daniel Thx. That was a typo in the post. In regards to QUITS, they are server bound, but they're still sent to your channel window as a QUITS level. You can still send these to another window, of which my post outlines, and succeeds with.

  3. Anonymous using Firefox 3.6 on Mac OS | March 14, 2010 at 12:23 am | Permalink

    Flexible, yes, but don't get too optimistic because you're going to have to hack through some pretty dense and occultly documented perl. Not that I don't like perl, or am not up for an occasional recreational diversion into hackery, but I guess it's been a while since I've fancied myself a computer geek.

  4. XeroXer using Google Chrome 5.0.307.11 on GNU/Linux 64 bits | March 18, 2010 at 12:30 am | Permalink

    I really like the setup apart from one problem I ended up with.
    My guess is that it has to do with my setup but all my private messages started a new window but all they wrote ended up in my 1st window, which was a bit annoying.

  5. Jamie Kirkpatrick using Google Chrome 8.0.552.237 on Mac OS | January 25, 2011 at 10:35 am | Permalink

    Good work that man! This is perfect for me...I can't stand all those "informative" messages getting in the way of real conversation...

  6. JCarroll using Google Chrome 20.0.1132.47 on Windows 7 | July 10, 2012 at 10:33 am | Permalink

    Thanks man - this article has helped me a lot! I seem to be having a problem tho: I logged out of IRSSI (windows version) and when I logged back in the next morning all my chats were going to main/first window (this is because window_check_level_first was on...). That setting saved... but none of my other settings saved. As soon as I turned it off, everything went back to the way it was originally (JOINS, PARTS, and QUITS started going to their respective windows and stopped piping to the JUNK window.

    Also, /set window_default ALL -JOINS -PARTS -QUITS (on both my debian AND win64 box) says it is an invalid command.

    Thoughts? (google search for "/set window_default" so I can debug why this didn't work turned up very little -- mostly your site).

    Thanks again for the post.

  7. sven using Google Chrome 22.0.1229.94 on Ubuntu 64 bits | January 14, 2013 at 7:49 am | Permalink

    /set window_default ALL -JOINS -PARTS -QUITS does not work in my irssi. /set window_default_level does work, though

{ 1 } Trackback

  1. [...] Irssi Handling JOINS/PARTS/QUITS [...]

Post a Comment

Your email is never published nor shared.

Switch to our mobile site