diff options
| author | Adam <Adam@drink-coca-cola.info> | 2010-05-17 20:33:28 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2010-06-18 21:03:41 -0400 |
| commit | 17ab4104005cc5098d9152e6c90d54977222dd06 (patch) | |
| tree | d8ffffedcf5537292a4f19faeb5f1e7796969132 /src/chanserv.c | |
| parent | 2a22d9c2fdf6978858055f1143af0ec40e417424 (diff) | |
Removed process_numlist and having to mark everything as "in use" and constantly checking it. Replaced with a better system.
Diffstat (limited to 'src/chanserv.c')
| -rw-r--r-- | src/chanserv.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/chanserv.c b/src/chanserv.c index 7f5602ed1..17dd65a7b 100644 --- a/src/chanserv.c +++ b/src/chanserv.c @@ -788,15 +788,15 @@ void cs_remove_nick(const NickCore * nc) { ca = ci->GetAccess(j - 1); - if (ca->in_use && ca->nc == nc) + if (ca->nc == nc) ci->EraseAccess(j - 1); } for (j = ci->GetAkickCount(); j > 0; --j) { akick = ci->GetAkick(j - 1); - if (akick->InUse && akick->HasFlag(AK_ISNICK) && akick->nc == nc) - ci->EraseAkick(akick); + if (akick->HasFlag(AK_ISNICK) && akick->nc == nc) + ci->EraseAkick(j - 1); } } } @@ -1054,6 +1054,22 @@ int get_access_level(ChannelInfo * ci, NickAlias * na) return access->level; } +int get_access_level(ChannelInfo *ci, NickCore *nc) +{ + if (!ci || !nc) + return 0; + + if (nc == ci->founder) + return ACCESS_FOUNDER; + + ChanAccess *access = ci->GetAccess(nc); + + if (!access) + return 0; + else + return access->level; +} + const char *get_xop_level(int level) { ChannelMode *halfop = ModeManager::FindChannelModeByName(CMODE_HALFOP); @@ -1091,7 +1107,7 @@ AutoKick *is_stuck(ChannelInfo * ci, const char *mask) { AutoKick *akick = ci->GetAkick(i); - if (!akick->InUse || akick->HasFlag(AK_ISNICK) || !akick->HasFlag(AK_STUCK)) + if (akick->HasFlag(AK_ISNICK) || !akick->HasFlag(AK_STUCK)) continue; if (Anope::Match(akick->mask, mask, false)) @@ -1146,7 +1162,7 @@ void stick_all(ChannelInfo * ci) { AutoKick *akick = ci->GetAkick(i); - if (!akick->InUse || (akick->HasFlag(AK_ISNICK) || !akick->HasFlag(AK_STUCK))) + if (akick->HasFlag(AK_ISNICK) || !akick->HasFlag(AK_STUCK)) continue; ci->c->SetMode(NULL, CMODE_BAN, akick->mask.c_str()); |
