Page 1 of 1

Remove ChanServ 'voice' messages in XChat

Posted: Mon Jun 21, 2010 3:16 am
by Suhana
Those of you have have been using the XChat support system will notice that we have implemented a "voicing" feature where everybody is automatically "voiced" on entry to #linuxmint-chat, #linuxmint-help and #pimpmymint. This is a system that allows the channel operators greater freedom to block unruly elements from spamming / trolling etc our great network.

However, as everybody is voiced on entry, the continual barrage of messages from ChanServ (the user or rather bot that performs the voicing for us), I wrote a little script to ignore those messages. A number of the channel ops use it already as do quite a few of our regulars, and with it's simplicity, you should be to!

Without further ado, I present novoice.py :

Code: Select all

#
#  Copyright (C) 2010, Suhana scripts@suhana.co.uk
#  All Rights Reserved.
#
#  Redistribution and use in source and binary forms, with or without
#  modification, are permitted provided that the following conditions are met:
#
#  * Redistributions of source code must retain the above copyright notice,
#    this list of conditions and the following disclaimer.
#
#  * Redistributions in binary form must reproduce the above copyright notice,
#    this list of conditions and the following disclaimer in the documentation
#    and/or other materials provided with the distribution.
#
#  * Neither the copyright holder nor the names of their contributors may be
#    used to endorse or promote products derived from this software without
#    specific prior written permission.
#
#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND CONTRIBUTORS
#  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
#  TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
#  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
#  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
#  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import xchat

__module_name__        = "novoice"
__module_version__     = "1.0"
__module_description__ = "Ignores voice messages from ChanServ"

def ignore_callback(word, word_eol, userdata):
	return xchat.EAT_XCHAT

xchat.hook_print("Channel Voice", ignore_callback)
Installation

You should save the code (copy and paste into and editor) above as the file " novoice.py " in your " .xchat2 " folder. Notice that's a hidden folder, so you should be very careful when typing the filename in.

Image

Once it's saved, you should simply restart (or start if not already running) your XChat and the script will automatically be loaded for you.

EDIT
Since I initially posted this, it appears the forums mechanism for copying text is not ideal, some people have reported "indentation errors". To address this, I'm also hosting the file : novoice.py. Right click, save the file as ~/.xchat2/novoice.py Restart XChat and you will enjoy the silence!

Re: Remove ChanServ 'voice' messages in XChat

Posted: Wed Jun 23, 2010 3:48 pm
by linXea
Super Suhana, great for everyone that uses X-Chat. I might post one for irssi and weeChat later.

Cheers

Re: Remove ChanServ 'voice' messages in XChat

Posted: Fri Dec 02, 2011 9:52 pm
by chorltoon
Just a note for anyone trying to download the file directly - it's currently missing the script code.

If you download it and follow the instructions, you'll end up with an empty html file, and might be confused about why it doesn't work. Instead, copy the script from the webpage and save it as instructed. Apart from that - many thanks to Suhana!