diff options
| author | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-10-13 21:26:38 +0000 |
|---|---|---|
| committer | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-10-13 21:26:38 +0000 |
| commit | d3d64c27b199622c90075d6f59dd08e44acbb378 (patch) | |
| tree | 68029e10dc754271235e2a4e3d04b3fb19ddd15c /src/botserv.c | |
| parent | 1fd66851320e239b531720c27614a5ad4c604c97 (diff) | |
Complete rewrite of everything associated with modes, this breaks saving and reading mlocked modes from the databases until the new databases are implemented
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2560 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/botserv.c')
| -rw-r--r-- | src/botserv.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src/botserv.c b/src/botserv.c index 3fc4c5c11..0e4f37600 100644 --- a/src/botserv.c +++ b/src/botserv.c @@ -772,12 +772,19 @@ void bot_join(ChannelInfo * ci) } } + std::string Limit; + int limit = 0; + if (ci->c->GetParam(CMODE_LIMIT, &Limit)) + { + limit = atoi(Limit.c_str()); + } + /* Should we be invited? */ - if ((ci->c->mode & anope_get_invite_mode()) - || (ci->c->limit && ci->c->usercount >= ci->c->limit)) + if (ci->c->HasMode(CMODE_INVITE) + || (limit && ci->c->usercount >= limit)) ircdproto->SendNoticeChanops(NULL, ci->c->name, - "%s invited %s into the channel.", - ci->bi->nick, ci->bi->nick); + "%s invited %s into the channel.", + ci->bi->nick, ci->bi->nick); } ircdproto->SendJoin(ci->bi, ci->c->name, ci->c->creation_time); ircdproto->SendBotOp(ci->bi->nick, ci->c->name); @@ -877,7 +884,8 @@ void bot_raw_ban(User * requester, ChannelInfo * ci, char *nick, if (!u) return; - if (ircd->protectedumode) { + if ((ModeManager::FindUserModeByName(UMODE_PROTECTED))) + { if (is_protected(u) && (requester != u)) { ircdproto->SendPrivmsg(ci->bi, ci->name, "%s", getstring(ACCESS_DENIED)); @@ -889,7 +897,8 @@ void bot_raw_ban(User * requester, ChannelInfo * ci, char *nick, && (get_access(u, ci) >= get_access(requester, ci))) return; - if (ircd->except) { + if (ModeManager::FindChannelModeByName(CMODE_EXCEPT)) + { if (is_excepted(ci, u) == 1) { ircdproto->SendPrivmsg(ci->bi, ci->name, "%s", getstring(BOT_EXCEPT)); @@ -953,7 +962,8 @@ void bot_raw_kick(User * requester, ChannelInfo * ci, char *nick, if (!u || !is_on_chan(ci->c, u)) return; - if (ircd->protectedumode) { + if ((ModeManager::FindUserModeByName(UMODE_PROTECTED))) + { if (is_protected(u) && (requester != u)) { ircdproto->SendPrivmsg(ci->bi, ci->name, "%s", getstring(ACCESS_DENIED)); @@ -1007,7 +1017,7 @@ void bot_raw_mode(User * requester, ChannelInfo * ci, const char *mode, snprintf(buf, BUFSIZE - 1, "%ld", static_cast<long>(time(NULL))); - if (ircd->protectedumode) { + if ((ModeManager::FindUserModeByName(UMODE_PROTECTED))) { if (is_protected(u) && *mode == '-' && (requester != u)) { ircdproto->SendPrivmsg(ci->bi, ci->name, "%s", getstring(ACCESS_DENIED)); |
