diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/cs_enforce.c | 4 | ||||
-rw-r--r-- | src/modules/cs_tban.c | 10 | ||||
-rw-r--r-- | src/modules/hs_request.c | 28 | ||||
-rw-r--r-- | src/modules/ns_maxemail.c | 7 | ||||
-rw-r--r-- | src/modules/os_info.c | 4 |
5 files changed, 31 insertions, 22 deletions
diff --git a/src/modules/cs_enforce.c b/src/modules/cs_enforce.c index ffdbb18d4..55990e06a 100644 --- a/src/modules/cs_enforce.c +++ b/src/modules/cs_enforce.c @@ -94,7 +94,7 @@ class CommandCSEnforce : public Command ChannelInfo *ci; int16 old_nojoin_level; char mask[BUFSIZE]; - char *reason; + const char *reason; const char *av[3]; User *u; @@ -136,7 +136,7 @@ class CommandCSEnforce : public Command struct c_userlist *next; ChannelInfo *ci; char mask[BUFSIZE]; - char *reason; + const char *reason; const char *av[3]; User *u; CBMode *cbm; diff --git a/src/modules/cs_tban.c b/src/modules/cs_tban.c index 51ef10b2c..0e86007d5 100644 --- a/src/modules/cs_tban.c +++ b/src/modules/cs_tban.c @@ -22,7 +22,7 @@ #define VERSION "$Id$" void myHelp(User *u); -void mySendResponse(User *u, char *channel, char *mask, char *time); +void mySendResponse(User *u, const char *channel, char *mask, const char *time); void addBan(Channel *c, time_t timeout, char *banmask); int delBan(int argc, char **argv); @@ -51,9 +51,9 @@ class CommandCSTBan : public Command Channel *c; User *u2 = NULL; - char *chan = params[0].c_str(); - char *nick = params[1].c_str(); - char *time = params[2].c_str(); + const char *chan = params[0].c_str(); + const char *nick = params[1].c_str(); + const char *time = params[2].c_str(); if (!(c = findchan(chan))) notice_lang(s_ChanServ, u, CHAN_X_NOT_IN_USE, chan); @@ -165,7 +165,7 @@ void myHelp(User *u) me->NoticeLang(s_ChanServ, u, TBAN_HELP); } -void mySendResponse(User *u, char *channel, char *mask, char *time) +void mySendResponse(User *u, const char *channel, char *mask, const char *time) { me->NoticeLang(s_ChanServ, u, TBAN_RESPONSE, mask, channel, time); } diff --git a/src/modules/hs_request.c b/src/modules/hs_request.c index 647d28a33..ab9044737 100644 --- a/src/modules/hs_request.c +++ b/src/modules/hs_request.c @@ -326,9 +326,9 @@ class CommandHSReject : public Command } }; -class CommandHSList : public Command +class HSListBase : public Command { - private: + protected: CommandReturn DoList(User *u, std::vector<std::string> ¶ms) { struct tm *tm; @@ -359,7 +359,20 @@ class CommandHSList : public Command return MOD_CONT; } public: - CommandHSList() : Command("LIST", 1, 1) + HSListBase(const std::string &cmd, int min, int max) : Command("LIST", 1, 1) + { + } + + void OnSyntaxError(User *u) + { + // no-op + } +}; + +class CommandHSList : public HSListBase +{ + public: + CommandHSList() : HSListBase("LIST", 1, 1) { } @@ -372,17 +385,12 @@ class CommandHSList : public Command return this->DoList(u, params); } - - void OnSyntaxError(User *u) - { - // no-op - } }; -class CommandHSWaiting : public CommandHSList +class CommandHSWaiting : public HSListBase { public: - CommandHSWaiting() : Command("WAITING", 0, 0) + CommandHSWaiting() : HSListBase("WAITING", 0, 0) { } diff --git a/src/modules/ns_maxemail.c b/src/modules/ns_maxemail.c index c2be798c8..1539c81c5 100644 --- a/src/modules/ns_maxemail.c +++ b/src/modules/ns_maxemail.c @@ -21,6 +21,7 @@ void my_load_config(); void my_add_languages(); int my_event_reload(int argc, char **argv); +CommandReturn check_email_limit_reached(const char *email, User * u); int NSEmailMax = 0; @@ -37,7 +38,7 @@ class CommandNSRegister : public Command { } - CommandReturn(User *u, std::vector<std::string> ¶ms) + CommandReturn Execute(User *u, std::vector<std::string> ¶ms) { return check_email_limit_reached(params[1].c_str(), u); } @@ -147,7 +148,7 @@ class NSMaxEmail : public Module }; -int count_email_in_use(char *email, User * u) +int count_email_in_use(const char *email, User * u) { NickCore *nc; int i; @@ -168,7 +169,7 @@ int count_email_in_use(char *email, User * u) return count; } -int check_email_limit_reached(char *email, User * u) +CommandReturn check_email_limit_reached(const char *email, User * u) { if (NSEmailMax < 1 || !email || is_services_admin(u)) return MOD_CONT; diff --git a/src/modules/os_info.c b/src/modules/os_info.c index d68cd0f96..7d4b7be8c 100644 --- a/src/modules/os_info.c +++ b/src/modules/os_info.c @@ -220,7 +220,7 @@ class CommandCSOInfo : public Command return MOD_CONT; } public: - CommandCSOInfo : Command("OINFO", 2, 3) + CommandCSOInfo() : Command("OINFO", 2, 3) { } @@ -261,7 +261,7 @@ class CommandCSInfo : public Command CommandReturn Execute(User *u, std::vector<std::string> ¶ms) { - char *chan = params[0].c_str(); + const char *chan = params[0].c_str(); ChannelInfo *ci = NULL; if (is_oper(u)) /* Only show our goodies to opers */ |