summaryrefslogtreecommitdiff
path: root/src/channels.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/channels.cpp')
-rw-r--r--src/channels.cpp22
1 files changed, 22 insertions, 0 deletions
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)