summaryrefslogtreecommitdiff
path: root/src/protocol/charybdis.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/protocol/charybdis.c')
-rw-r--r--src/protocol/charybdis.c90
1 files changed, 31 insertions, 59 deletions
diff --git a/src/protocol/charybdis.c b/src/protocol/charybdis.c
index b3e2337f7..e2983561f 100644
--- a/src/protocol/charybdis.c
+++ b/src/protocol/charybdis.c
@@ -146,49 +146,33 @@ IRCDCAPAB myIrcdcap[] = {
/*******************************************************************/
-void charybdis_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 CharybdisProto::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] = {
@@ -1489,25 +1473,13 @@ int anope_event_error(const char *source, int ac, const char **av)
1 = valid nick
0 = nick is in valid
*/
-int charybdis_valid_nick(const char *nick)
+int CharybdisProto::valid_nick(const char *nick)
{
- /* TS6 Save extension -Certus */
- if (isdigit(*nick))
- return 0;
- return 1;
+ /* TS6 Save extension -Certus */
+ if (isdigit(*nick)) return 0;
+ return 1;
}
-/*
- 1 = valid chan
- 0 = chan is invalid
-*/
-int charybdis_valid_chan(const char *chan)
-{
- /* no hard coded invalid chan */
- return 1;
-}
-
-
int charybdis_send_account(int argc, char **argv)
{
send_cmd((UseTS6 ? TS6SID : ServerName), "ENCAP * SU %s :%s",