summaryrefslogtreecommitdiff
path: root/include/modules/bs_kick.h
blob: 1346d7427e08ea454dd30048ef9cb9a18f24625b (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/* BotServ core functions
 *
 * (C) 2003-2014 Anope Team
 * Contact us at team@anope.org
 *
 * Please read COPYING and README for further details.
 *
 * Based on the original code of Epona by Lara.
 * Based on the original code of Services by Andy Church.
 *
 *
 */

class KickerData : public Serialize::Object
{
 protected:
	using Serialize::Object::Object;

 public:
	virtual ChanServ::Channel *GetChannel() anope_abstract;
	virtual void SetChannel(ChanServ::Channel *) anope_abstract;

	virtual bool GetAmsgs() anope_abstract;
	virtual void SetAmsgs(const bool &) anope_abstract;

	virtual bool GetBadwords() anope_abstract;
	virtual void SetBadwords(const bool &) anope_abstract;

	virtual bool GetBolds() anope_abstract;
	virtual void SetBolds(const bool &) anope_abstract;

	virtual bool GetCaps() anope_abstract;
	virtual void SetCaps(const bool &) anope_abstract;

	virtual bool GetColors() anope_abstract;
	virtual void SetColors(const bool &) anope_abstract;

	virtual bool GetFlood() anope_abstract;
	virtual void SetFlood(const bool &) anope_abstract;

	virtual bool GetItalics() anope_abstract;
	virtual void SetItalics(const bool &) anope_abstract;

	virtual bool GetRepeat() anope_abstract;
	virtual void SetRepeat(const bool &) anope_abstract;

	virtual bool GetReverses() anope_abstract;
	virtual void SetReverses(const bool &) anope_abstract;

	virtual bool GetUnderlines() anope_abstract;
	virtual void SetUnderlines(const bool &) anope_abstract;

	virtual int16_t GetTTBBolds() anope_abstract;
	virtual void SetTTBBolds(const int16_t &) anope_abstract;

	virtual int16_t GetTTBColors() anope_abstract;
	virtual void SetTTBColors(const int16_t &) anope_abstract;

	virtual int16_t GetTTBReverses() anope_abstract;
	virtual void SetTTBReverses(const int16_t &) anope_abstract;

	virtual int16_t GetTTBUnderlines() anope_abstract;
	virtual void SetTTBUnderlines(const int16_t &) anope_abstract;

	virtual int16_t GetTTBBadwords() anope_abstract;
	virtual void SetTTBBadwords(const int16_t &) anope_abstract;

	virtual int16_t GetTTBCaps() anope_abstract;
	virtual void SetTTBCaps(const int16_t &) anope_abstract;
	
	virtual int16_t GetTTBFlood() anope_abstract;
	virtual void SetTTBFlood(const int16_t &) anope_abstract;

	virtual int16_t GetTTBRepeat() anope_abstract;
	virtual void SetTTBRepeat(const int16_t &) anope_abstract;

	virtual int16_t GetTTBItalics() anope_abstract;
	virtual void SetTTBItalics(const int16_t &) anope_abstract;

	virtual int16_t GetTTBAmsgs() anope_abstract;
	virtual void SetTTBAmsgs(const int16_t &) anope_abstract;

	virtual int16_t GetCapsMin() anope_abstract;
	virtual void SetCapsMin(const int16_t &) anope_abstract;

	virtual int16_t GetCapsPercent() anope_abstract;
	virtual void SetCapsPercent(const int16_t &) anope_abstract;

	virtual int16_t GetFloodLines() anope_abstract;
	virtual void SetFloodLines(const int16_t &) anope_abstract;

	virtual int16_t GetFloodSecs() anope_abstract;
	virtual void SetFloodSecs(const int16_t &) anope_abstract;

	virtual int16_t GetRepeatTimes() anope_abstract;
	virtual void SetRepeatTimes(const int16_t &) anope_abstract;

	virtual bool GetDontKickOps() anope_abstract;
	virtual void SetDontKickOps(const bool &) anope_abstract;

	virtual bool GetDontKickVoices() anope_abstract;
	virtual void SetDontKickVoices(const bool &) anope_abstract;
};

static Serialize::TypeReference<KickerData> kickerdata("KickerData");

inline KickerData *GetKickerData(ChanServ::Channel *ci)
{
	KickerData *kd = ci->GetRef<KickerData *>(kickerdata);
	if (!kd && kickerdata)
	{
		kd = kickerdata.Create();
		kd->SetChannel(ci);
	}
	return kd;
}

namespace Event
{
	struct CoreExport BotBan : Events
	{
		/** Called when a bot places a ban
		 * @param u User being banned
		 * @param ci Channel the ban is placed on
		 * @param mask The mask being banned
		 */
		virtual void OnBotBan(User *u, ChanServ::Channel *ci, const Anope::string &mask) anope_abstract;
	};
}

template<> struct EventName<Event::BotBan> { static constexpr const char *const name = "OnBotBan"; };