Remove ChanServ 'voice' messages in XChat

Write tutorials here
There are more tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Do not start a support topic here please. Before you post please read this

Remove ChanServ 'voice' messages in XChat

Postby Suhana on Mon Jun 21, 2010 3:16 am

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!
Last edited by Suhana on Fri Aug 13, 2010 4:01 am, edited 2 times in total.
Suhana
 

Linux Mint is funded by ads and donations.
 

Re: Remove ChanServ 'voice' messages in XChat

Postby linXea on Wed Jun 23, 2010 3:48 pm

Super Suhana, great for everyone that uses X-Chat. I might post one for irssi and weeChat later.

Cheers
Image
Dektop: AMD Quad-Core, 4GB RAM, ATI HD3650silent, 33TB harddrive
Laptop: Lenovo Thinkpad x201, Intel core2centrino P9600, 4GB RAM, 750gb
User avatar
linXea
Level 3
Level 3
 
Posts: 182
Joined: Mon Aug 31, 2009 7:06 am
Location: Uppsala, Sweden

Re: Remove ChanServ 'voice' messages in XChat

Postby chorltoon on Fri Dec 02, 2011 9:52 pm

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!
chorltoon
Level 1
Level 1
 
Posts: 1
Joined: Thu May 26, 2011 8:49 am


Return to Tutorials

Who is online

Users browsing this forum: Google Feedfetcher and 6 guests