XChat plugin to show join/parts on specific channels
Tuesday, August 28th, 2007As I said before, you can permantly hide join and parts globally in XChat. Sometimes you want to show join/parts on some channels but not for others. This plugin allows you to specify some channels that you want to always show join/parts on, and some to never show join/parts. This will override the global settings.
Change the options at the start of the file and save as ~/.xchat2/customjoinparts.py
This version will always show join/parts on #python, and never on #xchat.
__module_name__ = "CustomJoinPart"
__module_version__ = "1.0"
__module_description__ = "Automatically show join parts on a per channel basis"
show_join_parts = [
[ 'FreeNode', '#python' ],
]
hide_join_parts = [
[ 'FreeNode', '#xchat'],
]
import xchat
def channel_joined(word, word_eol, userdata):
global show_join_parts, hide_join_parts
curr_channel = xchat.get_info("channel")
curr_network = xchat.get_info("network")
for network, channel in show_join_parts:
if curr_network == network and curr_channel == channel:
# this is the a channel we are to show join parts
xchat.command("CHANOPT CONFMODE OFF")
print "Showing Join/Parts in this channel"
for network, channel in hide_join_parts:
if curr_channel == network and curr_channel == channel:
xchat.command("CHANOPT CONFMODE ON")
print "Hiding all Join/Parts in this channel"
# Don't eat this event, let other plugins and xchat see it too
return xchat.EAT_NONE
xchat.hook_print( "You Join", channel_joined )
print __module_name__ + " version " + __module_version__ + " loaded"