Adding cmode +c

Amand Tihon ircd at alrj.org
Wed Nov 16 02:23:36 EST 2005


Hello,

I'm trying to add a +c cmode (strip colors) to hybrid 7.2rc1, but I've only 
played with hybrid's sources since yesterday, so please bear with me if I'm 
completely wrong :)

I wonder if there's a better way to add a new cmode. Here's what I've done:

In includes/channel_mode.h, I added 
	#define MODE_NOCOLOR    0x0200

In src/channel_modes.c, I modified the flags[] table, prepending the following 
line
	{ MODE_NOCOLOR,    'c' },
and the ModeTable corresponding line, so that it reads
	{chm_simple, (void *) MODE_NOCOLOR},            /* c */

My modules/m_nocolor.c then installs a hook on "channel_message".

My question is : would it be possible to add a cmode from a module, instead of 
patching the sources, or is this the normal way to do it ?

Thank you.

-- 
Amand Tihon



More information about the hybrid mailing list