1
0
mirror of https://github.com/anope/anope.git synced 2026-07-09 03:03:14 +02:00

Removed the AUTODEOP level, it is unnecessary now because of cs_mode

This commit is contained in:
Adam
2010-11-21 16:56:18 -05:00
parent 7790a7f98c
commit c5eb349d41
7 changed files with 8 additions and 42 deletions
-1
View File
@@ -269,7 +269,6 @@ enum LanguageString
CHAN_LEVEL_AUTOVOICE,
CHAN_LEVEL_AUTOHALFOP,
CHAN_LEVEL_AUTOPROTECT,
CHAN_LEVEL_AUTODEOP,
CHAN_LEVEL_NOJOIN,
CHAN_LEVEL_INVITE,
CHAN_LEVEL_AKICK,
-1
View File
@@ -629,7 +629,6 @@ enum ChannelAccess
CA_SET, /* but not FOUNDER or PASSWORD */
CA_UNBAN,
CA_AUTOOP,
CA_AUTODEOP, /* Maximum, not minimum */
CA_AUTOVOICE,
CA_OPDEOP, /* ChanServ commands OP and DEOP */
CA_ACCESS_LIST,
+2 -5
View File
@@ -270,7 +270,7 @@ class CommandCSAccess : public Command
if (i == end)
u->SendMessage(ChanServ, CHAN_ACCESS_NOT_FOUND, nick.c_str(), ci->name.c_str());
else if (nc != u->Account() && check_access(u, ci, CA_NOJOIN) && check_access(u, ci, CA_AUTODEOP) && get_access(u, ci) <= access->level && !u->Account()->HasPriv("chanserv/access/modify"))
else if (nc != u->Account() && check_access(u, ci, CA_NOJOIN) && get_access(u, ci) <= access->level && !u->Account()->HasPriv("chanserv/access/modify"))
u->SendMessage(ChanServ, ACCESS_DENIED);
else
{
@@ -556,10 +556,7 @@ class CommandCSLevels : public Command
{
j = levelinfo[i].what;
if (j == CA_AUTOOP || j == CA_AUTODEOP || j == CA_AUTOVOICE || j == CA_NOJOIN)
u->SendMessage(ChanServ, CHAN_LEVELS_LIST_DISABLED, levelinfo_maxwidth, levelinfo[i].name.c_str());
else
u->SendMessage(ChanServ, CHAN_LEVELS_LIST_DISABLED, levelinfo_maxwidth, levelinfo[i].name.c_str());
u->SendMessage(ChanServ, CHAN_LEVELS_LIST_DISABLED, levelinfo_maxwidth, levelinfo[i].name.c_str());
}
else if (j == ACCESS_FOUNDER)
u->SendMessage(ChanServ, CHAN_LEVELS_LIST_FOUNDER, levelinfo_maxwidth, levelinfo[i].name.c_str());
-1
View File
@@ -254,7 +254,6 @@ ChannelLevel ChannelLevels[] = {
{"SET", CA_SET},
{"UNBAN", CA_UNBAN},
{"AUTOOP", CA_AUTOOP},
{"AUTODEOP", CA_AUTODEOP},
{"AUTOVOICE", CA_AUTOVOICE},
{"OPDEOP", CA_OPDEOP},
{"ACCESS_LIST", CA_ACCESS_LIST},
+2 -2
View File
@@ -1183,8 +1183,8 @@ void chan_set_correct_modes(User *user, Channel *c, int give_modes)
else if (voice && check_access(user, ci, CA_AUTOVOICE))
c->SetMode(NULL, CMODE_VOICE, user->nick);
}
/* If this channel has secureops or the user matches autodeop or the channel is syncing and they are not ulined, check to remove modes */
if ((ci->HasFlag(CI_SECUREOPS) || check_access(user, ci, CA_AUTODEOP) || c->HasFlag(CH_SYNCING)) && !user->server->IsULined())
/* If this channel has secureops or the channel is syncing and they are not ulined, check to remove modes */
if ((ci->HasFlag(CI_SECUREOPS) || c->HasFlag(CH_SYNCING)) && !user->server->IsULined())
{
if (owner && c->HasUserStatus(user, CMODE_OWNER) && !check_access(user, ci, CA_FOUNDER))
c->RemoveMode(NULL, CMODE_OWNER, user->nick);
+3 -29
View File
@@ -19,7 +19,6 @@ registered_channel_map RegisteredChannelList;
static int def_levels[][2] = {
{ CA_AUTOOP, 5 },
{ CA_AUTOVOICE, 3 },
{ CA_AUTODEOP, -1 },
{ CA_NOJOIN, -2 },
{ CA_INVITE, 5 },
{ CA_AKICK, 10 },
@@ -61,7 +60,6 @@ static int def_levels[][2] = {
};
LevelInfo levelinfo[] = {
{ CA_AUTODEOP, "AUTODEOP", CHAN_LEVEL_AUTODEOP },
{ CA_AUTOHALFOP, "AUTOHALFOP", CHAN_LEVEL_AUTOHALFOP },
{ CA_AUTOOP, "AUTOOP", CHAN_LEVEL_AUTOOP },
{ CA_AUTOPROTECT, "AUTOPROTECT", CHAN_LEVEL_AUTOPROTECT },
@@ -310,12 +308,6 @@ int check_valid_admin(User *user, Channel *chan, int servermode)
return 0;
}
if (check_access(user, chan->ci, CA_AUTODEOP))
{
chan->RemoveMode(NULL, CMODE_PROTECT, user->nick);
return 0;
}
return 1;
}
@@ -354,20 +346,6 @@ int check_valid_op(User *user, Channel *chan, int servermode)
return 0;
}
if (check_access(user, chan->ci, CA_AUTODEOP))
{
chan->RemoveMode(NULL, CMODE_OP, user->nick);
if (owner)
chan->RemoveMode(NULL, CMODE_OWNER, user->nick);
if (protect)
chan->RemoveMode(NULL, CMODE_PROTECT, user->nick);
if (halfop)
chan->RemoveMode(NULL, CMODE_HALFOP, user->nick);
return 0;
}
return 1;
}
@@ -508,19 +486,15 @@ int check_access(User *user, ChannelInfo *ci, int what)
/* Superadmin always wins. Always. */
if (user->isSuperAdmin)
return what == CA_AUTODEOP || what == CA_NOJOIN ? 0 : 1;
return what == CA_NOJOIN ? 0 : 1;
/* If the access of the level we are checking is disabled, they *always* get denied */
if (limit == ACCESS_INVALID)
return 0;
/* If the level of the user is >= the level for "founder" of this channel and "founder" isn't disabled, they can do anything */
if (ci->levels[CA_FOUNDER] != ACCESS_INVALID && level >= ci->levels[CA_FOUNDER])
return what == CA_AUTODEOP || what == CA_NOJOIN ? 0 : 1;
return what == CA_NOJOIN ? 0 : 1;
/* Hacks to make flags work */
if (what == CA_AUTODEOP && ci->HasFlag(CI_SECUREOPS) && !level)
return 1;
if (what == CA_AUTODEOP || what == CA_NOJOIN)
if (what == CA_NOJOIN)
return level <= ci->levels[what];
else
return level >= ci->levels[what];
+1 -3
View File
@@ -707,8 +707,6 @@ const char *const language_strings[LANG_STRING_COUNT] = {
_("Automatic mode +h"),
/* CHAN_LEVEL_AUTOPROTECT */
_("Automatic mode +a"),
/* CHAN_LEVEL_AUTODEOP */
_("Channel operator status disallowed"),
/* CHAN_LEVEL_NOJOIN */
_("Not allowed to join channel"),
/* CHAN_LEVEL_INVITE */
@@ -3929,7 +3927,7 @@ const char *const language_strings[LANG_STRING_COUNT] = {
"set, see HELP LEVELS DESC."),
/* CHAN_HELP_LEVELS_DESC */
_("The following feature/function names are understood. Note\n"
"that the levels for AUTODEOP and NOJOIN are maximum levels,\n"
"that the leves for NOJOIN is the maximum level,\n"
"while all others are minimum levels."),
/* CHAN_HELP_LEVELS_DESC_FORMAT */
_(" %-*s %s"),