WeeChat DevCenter

Tag - ignore

Entries feed

Saturday, October 25 2008

Smart IRC join/part/quit message filter

A new smart filter for IRC join/part/quit message has been added. It is disabled by default (so you'll see all join/part/quit by default).

To enable it, use following commands:

/set irc.look.smart_filter on
/filter add irc_smart * irc_smart_filter *

You can setup delay: /set irc.look.smart_filter_delay 5

How does it work?

When a nick spoke on channel during past X minutes (where X is delay irc.look.smart_filter_delay), its join/part/quit will be displayed by default. Otherwise, if nick did not speak for a long time, all join/part/quit messages will be tagged with "irc_smart_filter". So you have to define a filter on this tag to hide join/part/quit from users that are not speaking on channel (see command above).

Thursday, September 4 2008

Ignore command, reloaded!

The new /ignore command is now available. You can ignore nicks (or hostnames), using regex.

Note: this command will be improved in near future with more options.

Some exemples (you can find them with /help ignore):

  • ignore nick "toto" everywhere: /ignore add toto
  • ignore host "toto@domain.com" on freenode server: /ignore add toto@domain.com freenode
  • ignore host "toto*@*.domain.com" on freenode/#weechat: /ignore add toto*@*.domain.com freenode #weechat

Saturday, March 22 2008

Filters and tags

Filters have been added. This feature replaces old /ignore command for IRC, but is more powerful and is not specific to IRC, it applies on buffer content. With new /filter command, you can ask WeeChat to filter lines displayed, by tags and/or regular expression on content of line. Unlike old /ignore command, the /filter command only hides lines, they are not removed, and you can see them when you want.

To understand filters, you should know what are tags. Each line displayed in a (formated) buffer may have optional tags, which are one or more words for this line. Number of tags is not limited, but should be reasonable (4 or 5 max). Tags are not visible (not displayed in buffer), they are used to filter content of buffers.

IRC plugin uses tags for all messages displayed if they're issued from an IRC server. Tags are: "irc_xxx" where "xxx" is the command received. For example if someone joins IRC channel, line with "--> nick has joined #channel" will have tag "irc_join". For IRC numeric command, tag is "irc_cmd_xxx" where "xxx" is number (3 digits), and second tag is "irc_numeric".

Some examples of filters:

  • filter IRC join/part/quit messages (if you find them boring!): /filter add joinquit * irc_join,irc_part,irc_quit *
  • filter lines containing word "spam": /filter add spamfilter * * spam
  • filter lines containing "weechat sucks" on channel #weechat: /filter add sucks irc.freenode.#weechat * weechat sucks


You can enable/disable filters by /filter command (look at /help filter) or with shortcut key meta + "=".

In a later version, you'll be able to see indicator in status bar, to know if filters are enabled or not, and if something is filtered on current buffer (lines hidden). This will be possible with new bars.