diff options
Diffstat (limited to 'src/protocol/inspircd11.c')
| -rw-r--r-- | src/protocol/inspircd11.c | 133 |
1 files changed, 51 insertions, 82 deletions
diff --git a/src/protocol/inspircd11.c b/src/protocol/inspircd11.c index e86724526..e196539aa 100644 --- a/src/protocol/inspircd11.c +++ b/src/protocol/inspircd11.c @@ -394,77 +394,57 @@ static int has_messagefloodmod = 0; static int has_banexceptionmod = 0; static int has_inviteexceptionmod = 0; -void inspircd_set_umode(User * user, int ac, const char **av) -{ - int add = 1; /* 1 if adding modes, 0 if deleting */ - const char *modes = av[0]; - - ac--; - - if (debug) - alog("debug: Changing mode for %s to %s", user->nick, modes); - - while (*modes) { - - /* This looks better, much better than "add ? (do_add) : (do_remove)". - * At least this is readable without paying much attention :) -GD - */ - if (add) - user->mode |= umodes[(int) *modes]; - else - user->mode &= ~umodes[(int) *modes]; - - switch (*modes++) { - case '+': - add = 1; - break; - case '-': - add = 0; - break; - case 'd': - if (ac == 0) { - break; - } - - ac--; - av++; - user->svid = strtoul(*av, NULL, 0); - break; - case 'o': - if (add) { - opcnt++; - if (WallOper) { - anope_cmd_global(s_OperServ, - "\2%s\2 is now an IRC operator.", - user->nick); - } - display_news(user, NEWS_OPER); - } else { - opcnt--; - } - break; - case 'a': - if (UnRestrictSAdmin) { - break; - } - if (add && !is_services_admin(user)) { - common_svsmode(user, "-a", NULL); - user->mode &= ~UMODE_a; - } - break; - case 'r': - user->svid = (add ? user->timestamp : 0); - if (add && !nick_identified(user)) { - common_svsmode(user, "-r", NULL); - user->mode &= ~UMODE_r; - } - break; - case 'x': - if (add) user->chost = user->vhost; - update_host(user); - break; - } - } +void InspIRCdProto::set_umode(User *user, int ac, const char **av) +{ + int add = 1; /* 1 if adding modes, 0 if deleting */ + const char *modes = av[0]; + --ac; + if (debug) alog("debug: Changing mode for %s to %s", user->nick, modes); + while (*modes) { + /* This looks better, much better than "add ? (do_add) : (do_remove)". + * At least this is readable without paying much attention :) -GD */ + if (add) user->mode |= umodes[static_cast<int>(*modes)]; + else user->mode &= ~umodes[static_cast<int>(*modes)]; + switch (*modes++) { + case '+': + add = 1; + break; + case '-': + add = 0; + break; + case 'd': + if (!ac) break; + --ac; + ++av; + user->svid = strtoul(*av, NULL, 0); + break; + case 'o': + if (add) { + ++opcnt; + if (WallOper) anope_cmd_global(s_OperServ, "\2%s\2 is now an IRC operator.", user->nick); + display_news(user, NEWS_OPER); + } + else --opcnt; + break; + case 'a': + if (UnRestrictSAdmin) break; + if (add && !is_services_admin(user)) { + common_svsmode(user, "-a", NULL); + user->mode &= ~UMODE_a; + } + break; + case 'r': + user->svid = add ? user->timestamp : 0; + if (add && !nick_identified(user)) { + common_svsmode(user, "-r", NULL); + user->mode &= ~UMODE_r; + } + break; + case 'x': + if (add) user->chost = user->vhost; + update_host(user); + } + } } @@ -1521,17 +1501,6 @@ int InspIRCdProto::flood_mode_check(const char *value) else return 0; } -int inspircd_valid_nick(const char *nick) -{ - return 1; -} - -int inspircd_valid_chan(const char *chan) -{ - return 1; -} - - /** * Tell anope which function we want to perform each task inside of anope. * These prototypes must match what anope expects. |
