summaryrefslogtreecommitdiff
path: root/src/protocol/ratbox.c
diff options
context:
space:
mode:
authorNaram Qashat cyberbotx@cyberbotx.com <Naram Qashat cyberbotx@cyberbotx.com@5417fbe8-f217-4b02-8779-1006273d7864>2008-10-01 19:16:23 +0000
committerNaram Qashat cyberbotx@cyberbotx.com <Naram Qashat cyberbotx@cyberbotx.com@5417fbe8-f217-4b02-8779-1006273d7864>2008-10-01 19:16:23 +0000
commit5d127f021d47c1a605b1c6c4cd94c9038ff46d99 (patch)
treeb08541ee2438c0f25e754b2e4a9af96a2630c142 /src/protocol/ratbox.c
parenteca7e896120cd57fe877a49ec9a3290760403cf2 (diff)
Added set_umode(), valid_nick(), valid_chan(), and flood_mode_check() from previous commits back in.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1289 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/protocol/ratbox.c')
-rw-r--r--src/protocol/ratbox.c88
1 files changed, 30 insertions, 58 deletions
diff --git a/src/protocol/ratbox.c b/src/protocol/ratbox.c
index f27c8d821..0a3b510ca 100644
--- a/src/protocol/ratbox.c
+++ b/src/protocol/ratbox.c
@@ -145,49 +145,33 @@ IRCDCAPAB myIrcdcap[] = {
0, 0, 0}
};
-void ratbox_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 '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;
- }
- }
+void RatboxProto::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 '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;
+ }
+ }
}
unsigned long umodes[128] = {
@@ -1388,25 +1372,13 @@ int anope_event_error(const char *source, int ac, const char **av)
1 = valid nick
0 = nick is in valid
*/
-int ratbox_valid_nick(const char *nick)
+int RatboxProto::valid_nick(const char *nick)
{
- /* TS6 Save extension -Certus */
- if (isdigit(*nick))
- return 0;
+ /* TS6 Save extension -Certus */
+ if (isdigit(*nick)) return 0;
return 1;
}
-/*
- 1 = valid chan
- 0 = chan is in valid
-*/
-int ratbox_valid_chan(const char *chan)
-{
- /* no hard coded invalid chans */
- return 1;
-}
-
-
/**
* Tell anope which function we want to perform each task inside of anope.
* These prototypes must match what anope expects.