summaryrefslogtreecommitdiff
path: root/src/channels.cpp
blob: afa748f08530f2be21fbe7581bce3a8dc97b6229 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "inspircd_config.h" 
#include "channels.h"
#include "inspircd.h"
#include <stdio.h>

chanrec::chanrec()
{
	strcpy(name,"");
	strcpy(custom_modes,"");
	strcpy(topic,"");
	strcpy(setby,"");
	strcpy(key,"");
	created = topicset = limit = 0;
	topiclock = noexternal = inviteonly = moderated = secret = c_private = false;
}

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)
{
}