From abdb186046bcdd83aefbc4171a00bd1ad7ec963c Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 3 Apr 2004 15:46:53 +0000 Subject: Added support for module-defined chanmodes with no parameters Fixed minor typo in example conf Added new stylesheet and docs git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@362 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/channels.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/channels.cpp') diff --git a/src/channels.cpp b/src/channels.cpp index 1d1b3edbe..afa748f08 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -16,6 +16,28 @@ chanrec::chanrec() void chanrec::SetCustomMode(char mode,bool mode_on) { + if (mode_on) { + char m[3]; + m[0] = mode; + m[1] = '\0'; + if (!strchr(this->custom_modes,mode)) + { + strncat(custom_modes,m,MAXMODES); + } + log(DEBUG,"Custom mode %c set",mode); + } + else { + char temp[MAXMODES]; + int count = 0; + for (int q = 0; q < strlen(custom_modes); q++) { + if (custom_modes[q] != mode) { + temp[count++] = mode; + } + } + temp[count] = '\0'; + strncpy(custom_modes,temp,MAXMODES); + log(DEBUG,"Custom mode %c removed",mode); + } } void chanrec::SetCustomModeParam(char mode,char* parameter,bool mode_on) -- cgit v1.3.1-10-gc9f91