summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2009-11-08 20:06:21 +0000
committerAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2009-11-08 20:06:21 +0000
commit458be36a321615c0f3004a6abde7e14d40f5da32 (patch)
tree711be83fc6f2d49f9d31015db51730cdac57f687 /src/core
parent38ad96c57c520dd84c8de21766f5de082a844a99 (diff)
Rewrote all of the old C style flag systems into a new Flag class which everything inherits from. This breaks reading and writing flags to the old databases (and probably many other things aswell) - Don't use it
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2636 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/core')
-rw-r--r--src/core/bs_assign.c4
-rw-r--r--src/core/bs_badwords.c2
-rw-r--r--src/core/bs_botlist.c4
-rw-r--r--src/core/bs_info.c34
-rw-r--r--src/core/bs_kick.c32
-rw-r--r--src/core/bs_set.c28
-rw-r--r--src/core/cs_access.c10
-rw-r--r--src/core/cs_akick.c61
-rw-r--r--src/core/cs_ban.c6
-rw-r--r--src/core/cs_drop.c10
-rw-r--r--src/core/cs_forbid.c2
-rw-r--r--src/core/cs_info.c37
-rw-r--r--src/core/cs_kick.c6
-rw-r--r--src/core/cs_list.c26
-rw-r--r--src/core/cs_modes.c25
-rw-r--r--src/core/cs_set.c88
-rw-r--r--src/core/cs_suspend.c8
-rw-r--r--src/core/cs_xop.c4
-rw-r--r--src/core/hs_del.c2
-rw-r--r--src/core/hs_delall.c2
-rw-r--r--src/core/hs_set.c2
-rw-r--r--src/core/hs_setall.c2
-rw-r--r--src/core/ms_cancel.c2
-rw-r--r--src/core/ms_check.c4
-rw-r--r--src/core/ms_info.c28
-rw-r--r--src/core/ms_list.c6
-rw-r--r--src/core/ms_read.c6
-rw-r--r--src/core/ms_set.c31
-rw-r--r--src/core/ns_access.c8
-rw-r--r--src/core/ns_alist.c8
-rw-r--r--src/core/ns_drop.c2
-rw-r--r--src/core/ns_forbid.c2
-rw-r--r--src/core/ns_getpass.c2
-rw-r--r--src/core/ns_ghost.c6
-rw-r--r--src/core/ns_group.c11
-rw-r--r--src/core/ns_identify.c6
-rw-r--r--src/core/ns_info.c20
-rw-r--r--src/core/ns_list.c38
-rw-r--r--src/core/ns_logout.c2
-rw-r--r--src/core/ns_recover.c6
-rw-r--r--src/core/ns_register.c5
-rw-r--r--src/core/ns_release.c8
-rw-r--r--src/core/ns_saset.c50
-rw-r--r--src/core/ns_sendpass.c2
-rw-r--r--src/core/ns_set.c46
-rw-r--r--src/core/ns_suspend.c14
-rw-r--r--src/core/os_jupe.c2
-rw-r--r--src/core/os_svsnick.c2
48 files changed, 355 insertions, 357 deletions
diff --git a/src/core/bs_assign.c b/src/core/bs_assign.c
index 1ca280c4c..e6d619095 100644
--- a/src/core/bs_assign.c
+++ b/src/core/bs_assign.c
@@ -43,13 +43,13 @@ class CommandBSAssign : public Command
ci = cs_findchan(chan);
- if ((ci->botflags & BS_NOBOT) || (!check_access(u, ci, CA_ASSIGN) && !u->nc->HasPriv("botserv/administration")))
+ if (ci->botflags.HasFlag(BS_NOBOT) || (!check_access(u, ci, CA_ASSIGN) && !u->nc->HasPriv("botserv/administration")))
{
notice_lang(s_BotServ, u, ACCESS_DENIED);
return MOD_CONT;
}
- if (bi->flags & BI_PRIVATE && !u->nc->HasCommand("botserv/assign/private"))
+ if (bi->HasFlag(BI_PRIVATE) && !u->nc->HasCommand("botserv/assign/private"))
{
notice_lang(s_BotServ, u, ACCESS_DENIED);
return MOD_CONT;
diff --git a/src/core/bs_badwords.c b/src/core/bs_badwords.c
index 8c07fb36a..405dbf2a6 100644
--- a/src/core/bs_badwords.c
+++ b/src/core/bs_badwords.c
@@ -57,7 +57,7 @@ class CommandBSBadwords : public Command
CommandReturn DoAdd(User *u, ChannelInfo *ci, const char *word)
{
char *opt, *pos;
- int type = BW_ANY;
+ BadWordType type = BW_ANY;
unsigned i = 0;
BadWord *bw;
diff --git a/src/core/bs_botlist.c b/src/core/bs_botlist.c
index 79902a752..c29ce19ee 100644
--- a/src/core/bs_botlist.c
+++ b/src/core/bs_botlist.c
@@ -34,7 +34,7 @@ class CommandBSBotList : public Command
for (i = 0; i < 256; i++) {
for (bi = botlists[i]; bi; bi = bi->next) {
- if (!(bi->flags & BI_PRIVATE)) {
+ if (!(bi->HasFlag(BI_PRIVATE))) {
if (!count)
notice_lang(s_BotServ, u, BOT_BOTLIST_HEADER);
count++;
@@ -48,7 +48,7 @@ class CommandBSBotList : public Command
for (i = 0; i < 256; i++) {
for (bi = botlists[i]; bi; bi = bi->next) {
- if (bi->flags & BI_PRIVATE) {
+ if (bi->HasFlag(BI_PRIVATE)) {
u->SendMessage(s_BotServ, " %-15s (%s@%s)", bi->nick, bi->user, bi->host);
count++;
}
diff --git a/src/core/bs_info.c b/src/core/bs_info.c
index 64d999768..0ea8a5791 100644
--- a/src/core/bs_info.c
+++ b/src/core/bs_info.c
@@ -72,11 +72,7 @@ class CommandBSInfo : public Command
tm = localtime(&bi->created);
strftime_lang(buf, sizeof(buf), u, STRFTIME_DATE_TIME_FORMAT, tm);
notice_lang(s_BotServ, u, BOT_INFO_BOT_CREATED, buf);
- notice_lang(s_BotServ, u, BOT_INFO_BOT_OPTIONS,
- getstring(u,
- (bi->
- flags & BI_PRIVATE) ? BOT_INFO_OPT_PRIVATE :
- BOT_INFO_OPT_NONE));
+ notice_lang(s_BotServ, u, BOT_INFO_BOT_OPTIONS, getstring(u, (bi->HasFlag(BI_PRIVATE) ? BOT_INFO_OPT_PRIVATE : BOT_INFO_OPT_NONE)));
notice_lang(s_BotServ, u, BOT_INFO_BOT_USAGE, bi->chancount);
if (u->nc->HasPriv("botserv/administration"))
@@ -96,7 +92,7 @@ class CommandBSInfo : public Command
else
notice_lang(s_BotServ, u, BOT_INFO_CHAN_BOT_NONE);
- if (ci->botflags & BS_KICK_BADWORDS) {
+ if (ci->botflags.HasFlag(BS_KICK_BADWORDS)) {
if (ci->ttb[TTB_BADWORDS])
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_BADWORDS_BAN,
getstring(u, BOT_INFO_ACTIVE),
@@ -107,7 +103,7 @@ class CommandBSInfo : public Command
} else
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_BADWORDS,
getstring(u, BOT_INFO_INACTIVE));
- if (ci->botflags & BS_KICK_BOLDS) {
+ if (ci->botflags.HasFlag(BS_KICK_BOLDS)) {
if (ci->ttb[TTB_BOLDS])
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_BOLDS_BAN,
getstring(u, BOT_INFO_ACTIVE),
@@ -118,7 +114,7 @@ class CommandBSInfo : public Command
} else
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_BOLDS,
getstring(u, BOT_INFO_INACTIVE));
- if (ci->botflags & BS_KICK_CAPS) {
+ if (ci->botflags.HasFlag(BS_KICK_CAPS)) {
if (ci->ttb[TTB_CAPS])
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_CAPS_BAN,
getstring(u, BOT_INFO_ACTIVE),
@@ -131,7 +127,7 @@ class CommandBSInfo : public Command
} else
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_CAPS_OFF,
getstring(u, BOT_INFO_INACTIVE));
- if (ci->botflags & BS_KICK_COLORS) {
+ if (ci->botflags.HasFlag(BS_KICK_COLORS)) {
if (ci->ttb[TTB_COLORS])
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_COLORS_BAN,
getstring(u, BOT_INFO_ACTIVE),
@@ -142,7 +138,7 @@ class CommandBSInfo : public Command
} else
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_COLORS,
getstring(u, BOT_INFO_INACTIVE));
- if (ci->botflags & BS_KICK_FLOOD) {
+ if (ci->botflags.HasFlag(BS_KICK_FLOOD)) {
if (ci->ttb[TTB_FLOOD])
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_FLOOD_BAN,
getstring(u, BOT_INFO_ACTIVE),
@@ -155,7 +151,7 @@ class CommandBSInfo : public Command
} else
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_FLOOD_OFF,
getstring(u, BOT_INFO_INACTIVE));
- if (ci->botflags & BS_KICK_REPEAT) {
+ if (ci->botflags.HasFlag(BS_KICK_REPEAT)) {
if (ci->ttb[TTB_REPEAT])
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_REPEAT_BAN,
getstring(u, BOT_INFO_ACTIVE),
@@ -167,7 +163,7 @@ class CommandBSInfo : public Command
} else
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_REPEAT_OFF,
getstring(u, BOT_INFO_INACTIVE));
- if (ci->botflags & BS_KICK_REVERSES) {
+ if (ci->botflags.HasFlag(BS_KICK_REVERSES)) {
if (ci->ttb[TTB_REVERSES])
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_REVERSES_BAN,
getstring(u, BOT_INFO_ACTIVE),
@@ -178,7 +174,7 @@ class CommandBSInfo : public Command
} else
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_REVERSES,
getstring(u, BOT_INFO_INACTIVE));
- if (ci->botflags & BS_KICK_UNDERLINES) {
+ if (ci->botflags.HasFlag(BS_KICK_UNDERLINES)) {
if (ci->ttb[TTB_UNDERLINES])
notice_lang(s_BotServ, u,
BOT_INFO_CHAN_KICK_UNDERLINES_BAN,
@@ -193,36 +189,36 @@ class CommandBSInfo : public Command
end = buf;
*end = 0;
- if (ci->botflags & BS_DONTKICKOPS) {
+ if (ci->botflags.HasFlag(BS_DONTKICKOPS)) {
end += snprintf(end, sizeof(buf) - (end - buf), "%s",
getstring(u, BOT_INFO_OPT_DONTKICKOPS));
need_comma = 1;
}
- if (ci->botflags & BS_DONTKICKVOICES) {
+ if (ci->botflags.HasFlag(BS_DONTKICKVOICES)) {
end += snprintf(end, sizeof(buf) - (end - buf), "%s%s",
need_comma ? commastr : "",
getstring(u, BOT_INFO_OPT_DONTKICKVOICES));
need_comma = 1;
}
- if (ci->botflags & BS_FANTASY) {
+ if (ci->botflags.HasFlag(BS_FANTASY)) {
end += snprintf(end, sizeof(buf) - (end - buf), "%s%s",
need_comma ? commastr : "",
getstring(u, BOT_INFO_OPT_FANTASY));
need_comma = 1;
}
- if (ci->botflags & BS_GREET) {
+ if (ci->botflags.HasFlag(BS_GREET)) {
end += snprintf(end, sizeof(buf) - (end - buf), "%s%s",
need_comma ? commastr : "",
getstring(u, BOT_INFO_OPT_GREET));
need_comma = 1;
}
- if (ci->botflags & BS_NOBOT) {
+ if (ci->botflags.HasFlag(BS_NOBOT)) {
end += snprintf(end, sizeof(buf) - (end - buf), "%s%s",
need_comma ? commastr : "",
getstring(u, BOT_INFO_OPT_NOBOT));
need_comma = 1;
}
- if (ci->botflags & BS_SYMBIOSIS) {
+ if (ci->botflags.HasFlag(BS_SYMBIOSIS)) {
end += snprintf(end, sizeof(buf) - (end - buf), "%s%s",
need_comma ? commastr : "",
getstring(u, BOT_INFO_OPT_SYMBIOSIS));
diff --git a/src/core/bs_kick.c b/src/core/bs_kick.c
index bd03ff006..0ce210019 100644
--- a/src/core/bs_kick.c
+++ b/src/core/bs_kick.c
@@ -65,14 +65,14 @@ class CommandBSKick : public Command
} else {
ci->ttb[TTB_BADWORDS] = 0;
}
- ci->botflags |= BS_KICK_BADWORDS;
+ ci->botflags.SetFlag(BS_KICK_BADWORDS);
if (ci->ttb[TTB_BADWORDS])
notice_lang(s_BotServ, u, BOT_KICK_BADWORDS_ON_BAN,
ci->ttb[TTB_BADWORDS]);
else
notice_lang(s_BotServ, u, BOT_KICK_BADWORDS_ON);
} else {
- ci->botflags &= ~BS_KICK_BADWORDS;
+ ci->botflags.UnsetFlag(BS_KICK_BADWORDS);
notice_lang(s_BotServ, u, BOT_KICK_BADWORDS_OFF);
}
} else if (option == "BOLDS") {
@@ -91,14 +91,14 @@ class CommandBSKick : public Command
}
} else
ci->ttb[TTB_BOLDS] = 0;
- ci->botflags |= BS_KICK_BOLDS;
+ ci->botflags.SetFlag(BS_KICK_BOLDS);
if (ci->ttb[TTB_BOLDS])
notice_lang(s_BotServ, u, BOT_KICK_BOLDS_ON_BAN,
ci->ttb[TTB_BOLDS]);
else
notice_lang(s_BotServ, u, BOT_KICK_BOLDS_ON);
} else {
- ci->botflags &= ~BS_KICK_BOLDS;
+ ci->botflags.UnsetFlag(BS_KICK_BOLDS);
notice_lang(s_BotServ, u, BOT_KICK_BOLDS_OFF);
}
} else if (option == "CAPS") {
@@ -135,7 +135,7 @@ class CommandBSKick : public Command
if (ci->capspercent < 1 || ci->capspercent > 100)
ci->capspercent = 25;
- ci->botflags |= BS_KICK_CAPS;
+ ci->botflags.SetFlag(BS_KICK_CAPS);
if (ci->ttb[TTB_CAPS])
notice_lang(s_BotServ, u, BOT_KICK_CAPS_ON_BAN,
ci->capsmin, ci->capspercent,
@@ -144,7 +144,7 @@ class CommandBSKick : public Command
notice_lang(s_BotServ, u, BOT_KICK_CAPS_ON,
ci->capsmin, ci->capspercent);
} else {
- ci->botflags &= ~BS_KICK_CAPS;
+ ci->botflags.UnsetFlag(BS_KICK_CAPS);
notice_lang(s_BotServ, u, BOT_KICK_CAPS_OFF);
}
} else if (option == "COLORS") {
@@ -163,14 +163,14 @@ class CommandBSKick : public Command
}
} else
ci->ttb[TTB_COLORS] = 0;
- ci->botflags |= BS_KICK_COLORS;
+ ci->botflags.SetFlag(BS_KICK_COLORS);
if (ci->ttb[TTB_COLORS])
notice_lang(s_BotServ, u, BOT_KICK_COLORS_ON_BAN,
ci->ttb[TTB_COLORS]);
else
notice_lang(s_BotServ, u, BOT_KICK_COLORS_ON);
} else {
- ci->botflags &= ~BS_KICK_COLORS;
+ ci->botflags.UnsetFlag(BS_KICK_COLORS);
notice_lang(s_BotServ, u, BOT_KICK_COLORS_OFF);
}
} else if (option == "FLOOD") {
@@ -207,7 +207,7 @@ class CommandBSKick : public Command
if (ci->floodsecs < 1 || ci->floodsecs > BSKeepData)
ci->floodsecs = 10;
- ci->botflags |= BS_KICK_FLOOD;
+ ci->botflags.SetFlag(BS_KICK_FLOOD);
if (ci->ttb[TTB_FLOOD])
notice_lang(s_BotServ, u, BOT_KICK_FLOOD_ON_BAN,
ci->floodlines, ci->floodsecs,
@@ -216,7 +216,7 @@ class CommandBSKick : public Command
notice_lang(s_BotServ, u, BOT_KICK_FLOOD_ON,
ci->floodlines, ci->floodsecs);
} else {
- ci->botflags &= ~BS_KICK_FLOOD;
+ ci->botflags.UnsetFlag(BS_KICK_FLOOD);
notice_lang(s_BotServ, u, BOT_KICK_FLOOD_OFF);
}
} else if (option == "REPEAT") {
@@ -245,7 +245,7 @@ class CommandBSKick : public Command
if (ci->repeattimes < 2)
ci->repeattimes = 3;
- ci->botflags |= BS_KICK_REPEAT;
+ ci->botflags.SetFlag(BS_KICK_REPEAT);
if (ci->ttb[TTB_REPEAT])
notice_lang(s_BotServ, u, BOT_KICK_REPEAT_ON_BAN,
ci->repeattimes, ci->ttb[TTB_REPEAT]);
@@ -253,7 +253,7 @@ class CommandBSKick : public Command
notice_lang(s_BotServ, u, BOT_KICK_REPEAT_ON,
ci->repeattimes);
} else {
- ci->botflags &= ~BS_KICK_REPEAT;
+ ci->botflags.UnsetFlag(BS_KICK_REPEAT);
notice_lang(s_BotServ, u, BOT_KICK_REPEAT_OFF);
}
} else if (option == "REVERSES") {
@@ -273,14 +273,14 @@ class CommandBSKick : public Command
}
} else
ci->ttb[TTB_REVERSES] = 0;
- ci->botflags |= BS_KICK_REVERSES;
+ ci->botflags.SetFlag(BS_KICK_REVERSES);
if (ci->ttb[TTB_REVERSES])
notice_lang(s_BotServ, u, BOT_KICK_REVERSES_ON_BAN,
ci->ttb[TTB_REVERSES]);
else
notice_lang(s_BotServ, u, BOT_KICK_REVERSES_ON);
} else {
- ci->botflags &= ~BS_KICK_REVERSES;
+ ci->botflags.UnsetFlag(BS_KICK_REVERSES);
notice_lang(s_BotServ, u, BOT_KICK_REVERSES_OFF);
}
} else if (option == "UNDERLINES") {
@@ -300,14 +300,14 @@ class CommandBSKick : public Command
}
} else
ci->ttb[TTB_UNDERLINES] = 0;
- ci->botflags |= BS_KICK_UNDERLINES;
+ ci->botflags.SetFlag(BS_KICK_UNDERLINES);
if (ci->ttb[TTB_UNDERLINES])
notice_lang(s_BotServ, u, BOT_KICK_UNDERLINES_ON_BAN,
ci->ttb[TTB_UNDERLINES]);
else
notice_lang(s_BotServ, u, BOT_KICK_UNDERLINES_ON);
} else {
- ci->botflags &= ~BS_KICK_UNDERLINES;
+ ci->botflags.UnsetFlag(BS_KICK_UNDERLINES);
notice_lang(s_BotServ, u, BOT_KICK_UNDERLINES_OFF);
}
} else
diff --git a/src/core/bs_set.c b/src/core/bs_set.c
index 7c5366003..d5d40abd5 100644
--- a/src/core/bs_set.c
+++ b/src/core/bs_set.c
@@ -48,12 +48,12 @@ class CommandBSSet : public Command
if (value == "ON")
{
- bi->flags |= BI_PRIVATE;
+ bi->SetFlag(BI_PRIVATE);
notice_lang(s_BotServ, u, BOT_SET_PRIVATE_ON, bi->nick);
}
else if (value == "OFF")
{
- bi->flags &= ~BI_PRIVATE;
+ bi->UnsetFlag(BI_PRIVATE);
notice_lang(s_BotServ, u, BOT_SET_PRIVATE_OFF, bi->nick);
}
else
@@ -68,11 +68,11 @@ class CommandBSSet : public Command
else {
if (option == "DONTKICKOPS") {
if (value == "ON") {
- ci->botflags |= BS_DONTKICKOPS;
+ ci->botflags.SetFlag(BS_DONTKICKOPS);
notice_lang(s_BotServ, u, BOT_SET_DONTKICKOPS_ON,
ci->name);
} else if (value == "OFF") {
- ci->botflags &= ~BS_DONTKICKOPS;
+ ci->botflags.UnsetFlag(BS_DONTKICKOPS);
notice_lang(s_BotServ, u, BOT_SET_DONTKICKOPS_OFF,
ci->name);
} else {
@@ -81,11 +81,11 @@ class CommandBSSet : public Command
}
} else if (option == "DONTKICKVOICES") {
if (value == "ON") {
- ci->botflags |= BS_DONTKICKVOICES;
+ ci->botflags.SetFlag(BS_DONTKICKVOICES);
notice_lang(s_BotServ, u, BOT_SET_DONTKICKVOICES_ON,
ci->name);
} else if (value == "OFF") {
- ci->botflags &= ~BS_DONTKICKVOICES;
+ ci->botflags.UnsetFlag(BS_DONTKICKVOICES);
notice_lang(s_BotServ, u, BOT_SET_DONTKICKVOICES_OFF,
ci->name);
} else {
@@ -94,10 +94,10 @@ class CommandBSSet : public Command
}
} else if (option == "FANTASY") {
if (value == "ON") {
- ci->botflags |= BS_FANTASY;
+ ci->botflags.SetFlag(BS_FANTASY);
notice_lang(s_BotServ, u, BOT_SET_FANTASY_ON, ci->name);
} else if (value == "OFF") {
- ci->botflags &= ~BS_FANTASY;
+ ci->botflags.UnsetFlag(BS_FANTASY);
notice_lang(s_BotServ, u, BOT_SET_FANTASY_OFF, ci->name);
} else {
syntax_error(s_BotServ, u, "SET FANTASY",
@@ -105,10 +105,10 @@ class CommandBSSet : public Command
}
} else if (option == "GREET") {
if (value == "ON") {
- ci->botflags |= BS_GREET;
+ ci->botflags.SetFlag(BS_GREET);
notice_lang(s_BotServ, u, BOT_SET_GREET_ON, ci->name);
} else if (value == "OFF") {
- ci->botflags &= ~BS_GREET;
+ ci->botflags.UnsetFlag(BS_GREET);
notice_lang(s_BotServ, u, BOT_SET_GREET_OFF, ci->name);
} else {
syntax_error(s_BotServ, u, "SET GREET",
@@ -116,12 +116,12 @@ class CommandBSSet : public Command
}
} else if (u->nc->HasCommand("botserv/set/nobot") && option == "NOBOT") {
if (value == "ON") {
- ci->botflags |= BS_NOBOT;
+ ci->botflags.SetFlag(BS_NOBOT);
if (ci->bi)
ci->bi->UnAssign(u, ci);
notice_lang(s_BotServ, u, BOT_SET_NOBOT_ON, ci->name);
} else if (value == "OFF") {
- ci->botflags &= ~BS_NOBOT;
+ ci->botflags.UnsetFlag(BS_NOBOT);
notice_lang(s_BotServ, u, BOT_SET_NOBOT_OFF, ci->name);
} else {
syntax_error(s_BotServ, u, "SET NOBOT",
@@ -129,10 +129,10 @@ class CommandBSSet : public Command
}
} else if (option == "SYMBIOSIS") {
if (value == "ON") {
- ci->botflags |= BS_SYMBIOSIS;
+ ci->botflags.SetFlag(BS_SYMBIOSIS);
notice_lang(s_BotServ, u, BOT_SET_SYMBIOSIS_ON, ci->name);
} else if (value == "OFF") {
- ci->botflags &= ~BS_SYMBIOSIS;
+ ci->botflags.UnsetFlag(BS_SYMBIOSIS);
notice_lang(s_BotServ, u, BOT_SET_SYMBIOSIS_OFF, ci->name);
} else {
syntax_error(s_BotServ, u, "SET SYMBIOSIS",
diff --git a/src/core/cs_access.c b/src/core/cs_access.c
index cd8ccb0cf..11fc323e7 100644
--- a/src/core/cs_access.c
+++ b/src/core/cs_access.c
@@ -61,7 +61,7 @@ static int access_list(User * u, int index, ChannelInfo * ci, int *sent_header)
*sent_header = 1;
}
- if (ci->flags & CI_XOP)
+ if (ci->HasFlag(CI_XOP))
{
xop = get_xop_level(access->level);
notice_lang(s_ChanServ, u, CHAN_ACCESS_LIST_XOP_FORMAT, index + 1, xop, access->nc->display);
@@ -107,7 +107,7 @@ static int access_view(User *u, int index, ChannelInfo *ci, int *sent_header)
strftime_lang(timebuf, sizeof(timebuf), u, STRFTIME_DATE_TIME_FORMAT, &tm);
}
- if (ci->flags & CI_XOP)
+ if (ci->HasFlag(CI_XOP))
{
xop = get_xop_level(access->level);
notice_lang(s_ChanServ, u, CHAN_ACCESS_VIEW_XOP_FORMAT, index + 1, xop, access->nc->display, access->creator.c_str(), timebuf);
@@ -155,7 +155,7 @@ class CommandCSAccess : public Command
if (is_list || cmd == "CLEAR" ? 0 : (cmd == "DEL" ? (!nick || s) : !s))
this->OnSyntaxError(u);
/* We still allow LIST in xOP mode, but not others */
- else if ((ci->flags & CI_XOP) && !is_list)
+ else if ((ci->HasFlag(CI_XOP)) && !is_list)
{
if (ModeManager::FindChannelModeByName(CMODE_HALFOP))
notice_lang(s_ChanServ, u, CHAN_ACCESS_XOP_HOP, s_ChanServ);
@@ -202,7 +202,7 @@ class CommandCSAccess : public Command
notice_lang(s_ChanServ, u, CHAN_ACCESS_NICKS_ONLY);
return MOD_CONT;
}
- if (na->status & NS_FORBIDDEN)
+ if (na->HasFlag(NS_FORBIDDEN));
{
notice_lang(s_ChanServ, u, NICK_X_FORBIDDEN, nick);
return MOD_CONT;
@@ -446,7 +446,7 @@ class CommandCSLevels : public Command
*/
if (cmd == "SET" ? !s : (cmd.substr(0, 3) == "DIS" ? (!what || s) : !!what))
this->OnSyntaxError(u);
- else if (ci->flags & CI_XOP)
+ else if (ci->HasFlag(CI_XOP))
notice_lang(s_ChanServ, u, CHAN_LEVELS_XOP);
else if (!IsFounder(u, ci) && !u->nc->HasPriv("chanserv/access/modify"))
notice_lang(s_ChanServ, u, ACCESS_DENIED);
diff --git a/src/core/cs_akick.c b/src/core/cs_akick.c
index c93c3a0aa..078cd0e2e 100644
--- a/src/core/cs_akick.c
+++ b/src/core/cs_akick.c
@@ -65,7 +65,7 @@ int akick_list(User * u, int index, ChannelInfo * ci, int *sent_header)
{
AutoKick *akick = ci->GetAkick(index);
- if (!(akick->flags & AK_USED))
+ if (!(akick->HasFlag(AK_USED)))
return 0;
if (!*sent_header) {
notice_lang(s_ChanServ, u, CHAN_AKICK_LIST_HEADER, ci->name);
@@ -73,7 +73,7 @@ int akick_list(User * u, int index, ChannelInfo * ci, int *sent_header)
}
notice_lang(s_ChanServ, u, CHAN_AKICK_LIST_FORMAT, index + 1,
- ((akick->flags & AK_ISNICK) ? akick->nc->
+ ((akick->HasFlag(AK_ISNICK)) ? akick->nc->
display : akick->mask.c_str()),
(!akick->reason.empty() ? akick->
reason.c_str() : getstring(u, NO_REASON)));
@@ -95,7 +95,7 @@ int akick_view(User * u, int index, ChannelInfo * ci, int *sent_header)
char timebuf[64];
struct tm tm;
- if (!(akick->flags & AK_USED))
+ if (!(akick->HasFlag(AK_USED)))
return 0;
if (!*sent_header) {
notice_lang(s_ChanServ, u, CHAN_AKICK_LIST_HEADER, ci->name);
@@ -110,17 +110,10 @@ int akick_view(User * u, int index, ChannelInfo * ci, int *sent_header)
snprintf(timebuf, sizeof(timebuf), "%s", getstring(u, UNKNOWN));
}
- notice_lang(s_ChanServ, u,
- ((akick->
- flags & AK_STUCK) ? CHAN_AKICK_VIEW_FORMAT_STUCK :
- CHAN_AKICK_VIEW_FORMAT), index + 1,
- ((akick->flags & AK_ISNICK) ? akick->nc->
- display : akick->mask.c_str()),
- !akick->creator.empty() ? akick->creator.c_str() : getstring(u,
- UNKNOWN),
- timebuf,
- (!akick->reason.empty() ? akick->
- reason.c_str() : getstring(u, NO_REASON)));
+ notice_lang(s_ChanServ, u, (akick->HasFlag(AK_STUCK) ? CHAN_AKICK_VIEW_FORMAT_STUCK : CHAN_AKICK_VIEW_FORMAT), index + 1,
+ ((akick->HasFlag(AK_ISNICK)) ? akick->nc->display : akick->mask.c_str()),
+ !akick->creator.empty() ? akick->creator.c_str() : getstring(u, UNKNOWN), timebuf,
+ (!akick->reason.empty() ? akick->reason.c_str() : getstring(u, NO_REASON)));
return 1;
}
@@ -167,7 +160,7 @@ class CommandCSAKick : public Command
}
else
{
- if (na->status & NS_FORBIDDEN)
+ if (na->HasFlag(NS_FORBIDDEN))
{
notice_lang(s_ChanServ, u, NICK_X_FORBIDDEN, mask.c_str());
return;
@@ -188,7 +181,7 @@ class CommandCSAKick : public Command
/* Check whether target nick has equal/higher access
* or whether the mask matches a user with higher/equal access - Viper */
- if ((ci->flags & CI_PEACE) && nc)
+ if ((ci->HasFlag(CI_PEACE)) && nc)
{
if ((nc == ci->founder) || (get_access_nc(nc, ci) >= get_access(u, ci)))
{
@@ -196,7 +189,7 @@ class CommandCSAKick : public Command
return;
}
}
- else if ((ci->flags & CI_PEACE))
+ else if ((ci->HasFlag(CI_PEACE)))
{
char buf[BUFSIZE];
/* Match against all currently online users with equal or
@@ -223,7 +216,7 @@ class CommandCSAKick : public Command
{
for (NickAlias *na2 = nalists[i]; na2; na2 = na2->next)
{
- if (na2->status & NS_FORBIDDEN)
+ if (na2->HasFlag(NS_FORBIDDEN))
continue;
if (na2->nc && ((na2->nc == ci->founder) || (get_access_nc(na2->nc, ci) >= get_access(u, ci))))
@@ -242,11 +235,11 @@ class CommandCSAKick : public Command
for (unsigned j = 0; j < ci->GetAkickCount(); ++j)
{
akick = ci->GetAkick(j);
- if (!(akick->flags & AK_USED))
+ if (!(akick->HasFlag(AK_USED)))
continue;
- if ((akick->flags & AK_ISNICK) ? akick->nc == nc : akick->mask == mask)
+ if ((akick->HasFlag(AK_ISNICK)) ? akick->nc == nc : akick->mask == mask)
{
- notice_lang(s_ChanServ, u, CHAN_AKICK_ALREADY_EXISTS, (akick->flags & AK_ISNICK) ? akick->nc->display : akick->mask.c_str(), ci->name);
+ notice_lang(s_ChanServ, u, CHAN_AKICK_ALREADY_EXISTS, (akick->HasFlag(AK_ISNICK)) ? akick->nc->display : akick->mask.c_str(), ci->name);
return;
}
}
@@ -291,7 +284,7 @@ class CommandCSAKick : public Command
{
akick = ci->GetAkick(i);
- if (!(akick->flags & AK_USED) || (akick->flags & AK_ISNICK))
+ if (!akick->HasFlag(AK_USED) || akick->HasFlag(AK_ISNICK))
continue;
if (akick->mask == mask)
break;
@@ -303,7 +296,7 @@ class CommandCSAKick : public Command
return;
}
- akick->flags |= AK_STUCK;
+ akick->SetFlag(AK_STUCK);
notice_lang(s_ChanServ, u, CHAN_AKICK_STUCK, akick->mask.c_str(), ci->name);
if (ci->c)
@@ -331,7 +324,7 @@ class CommandCSAKick : public Command
{
akick = ci->GetAkick(i);
- if (!(akick->flags & AK_USED) || (akick->flags & AK_ISNICK))
+ if (!akick->HasFlag(AK_USED) || akick->HasFlag(AK_ISNICK))
continue;
if (akick->mask == mask)
break;
@@ -343,7 +336,7 @@ class CommandCSAKick : public Command
return;
}
- akick->flags &= ~AK_STUCK;
+ akick->UnsetFlag(AK_STUCK);
notice_lang(s_ChanServ, u, CHAN_AKICK_UNSTUCK, akick->mask.c_str(), ci->name);
}
@@ -387,10 +380,10 @@ class CommandCSAKick : public Command