WeeChat DevCenter

Tag - tag

Entries feed

Tuesday, November 27 2012

Tags in IRC messages

Tags in IRC messages are now supported (in development version, planned for version 0.4.0), following this specification: http://ircv3.atheme.org/specification/message-tags-3.2.

The tag "time" is now read and is used to set the time for the message displayed.

The "znc" IRC bouncer is using this tag with the capability "znc.in/server-time-iso" (name should change in the next release). For example if you are using a server called "znc" in WeeChat, you can do:

/set irc.server.znc.capabilities "znc.in/server-time-iso"

Note: with znc 1.0, the server capability was "znc.in/server-time". With znc git > 1.0, the capability is "znc.in/server-time-iso".

Some info about capability "server-time": https://github.com/atheme/ircv3-specifications/blob/master/extensions/server-time-3.2.

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.