diff options
Diffstat (limited to 'src/protocol')
| -rw-r--r-- | src/protocol/bahamut.c | 11 | ||||
| -rw-r--r-- | src/protocol/inspircd11.c | 9 | ||||
| -rw-r--r-- | src/protocol/inspircd12.cpp | 6 | ||||
| -rw-r--r-- | src/protocol/ratbox.c | 6 | ||||
| -rw-r--r-- | src/protocol/unreal32.c | 13 |
5 files changed, 26 insertions, 19 deletions
diff --git a/src/protocol/bahamut.c b/src/protocol/bahamut.c index aee8b6f22..f00982d6b 100644 --- a/src/protocol/bahamut.c +++ b/src/protocol/bahamut.c @@ -167,9 +167,9 @@ class BahamutIRCdProto : public IRCDProto } /* SVSMODE -b */ - void SendBanDel(Channel *c, const char *nick) + void SendBanDel(Channel *c, const std::string &nick) { - SendSVSModeChan(c, "-b", nick); + SendSVSModeChan(c, "-b", nick.empty() ? NULL : nick.c_str()); } /* SVSMODE channel modes */ @@ -180,10 +180,11 @@ class BahamutIRCdProto : public IRCDProto } /* SQLINE */ - void SendSQLine(const char *mask, const char *reason) + void SendSQLine(const std::string &mask, const std::string &reason) { - if (!mask || !reason) return; - send_cmd(NULL, "SQLINE %s :%s", mask, reason); + if (mask.empty() || reason.empty()) + return; + send_cmd(NULL, "SQLINE %s :%s", mask.c_str(), reason.c_str()); } /* UNSGLINE */ diff --git a/src/protocol/inspircd11.c b/src/protocol/inspircd11.c index cdeb58797..eb2718a7a 100644 --- a/src/protocol/inspircd11.c +++ b/src/protocol/inspircd11.c @@ -135,7 +135,7 @@ void inspircd_cmd_chghost(const char *nick, const char *vhost) return; send_cmd(Config.s_OperServ, "CHGHOST %s %s", nick, vhost); } - else + else ircdproto->SendGlobops(findbot(Config.s_OperServ), "CHGHOST not loaded!"); } @@ -260,10 +260,11 @@ class InspIRCdProto : public IRCDProto } /* SQLINE */ - void SendSQLine(const char *mask, const char *reason) + void SendSQLine(const std::string &mask, const std::string &reason) { - if (!mask || !reason) return; - send_cmd(Config.ServerName, "ADDLINE Q %s %s %ld 0 :%s", mask, Config.s_OperServ, static_cast<long>(time(NULL)), reason); + if (mask.empty() || reason.empty()) + return; + send_cmd(Config.ServerName, "ADDLINE Q %s %s %ld 0 :%s", mask.c_str(), Config.s_OperServ, static_cast<long>(time(NULL)), reason.c_str()); } /* SQUIT */ diff --git a/src/protocol/inspircd12.cpp b/src/protocol/inspircd12.cpp index 7c67d0524..0af116070 100644 --- a/src/protocol/inspircd12.cpp +++ b/src/protocol/inspircd12.cpp @@ -265,9 +265,11 @@ class InspIRCdProto : public IRCDProto } /* SQLINE */ - void SendSQLine(const char *mask, const char *reason) + void SendSQLine(const std::string &mask, const std::string &reason) { - send_cmd(TS6SID, "ADDLINE Q %s %s %ld 0 :%s", mask, Config.s_OperServ, static_cast<long>(time(NULL)), reason); + if (mask.empty() || reason.empty()) + return; + send_cmd(TS6SID, "ADDLINE Q %s %s %ld 0 :%s", mask.c_str(), Config.s_OperServ, static_cast<long>(time(NULL)), reason.c_str()); } /* SQUIT */ diff --git a/src/protocol/ratbox.c b/src/protocol/ratbox.c index 3b9f982aa..78be63723 100644 --- a/src/protocol/ratbox.c +++ b/src/protocol/ratbox.c @@ -173,9 +173,11 @@ class RatboxProto : public IRCDTS6Proto send_cmd(TS6SID, "OPERWALL :%s", buf); } - void SendSQLine(const char *mask, const char *reason) + void SendSQLine(const std::string &mask, const std::string &reason) { - send_cmd(TS6SID, "RESV * %s :%s", mask, reason); + if (mask.empty() || reason.empty()) + return; + send_cmd(TS6SID, "RESV * %s :%s", mask.c_str(), reason.c_str()); } void SendSGLineDel(SXLine *sx) diff --git a/src/protocol/unreal32.c b/src/protocol/unreal32.c index 085107e5c..7e8d0985b 100644 --- a/src/protocol/unreal32.c +++ b/src/protocol/unreal32.c @@ -290,10 +290,11 @@ class UnrealIRCdProto : public IRCDProto ** - Unreal will translate this to TKL for us ** */ - void SendSQLine(const char *mask, const char *reason) + void SendSQLine(const std::string &mask, const std::string &reason) { - if (!mask || !reason) return; - send_cmd(NULL, "c %s :%s", mask, reason); + if (mask.empty() || reason.empty()) + return; + send_cmd(NULL, "c %s :%s", mask.c_str(), reason.c_str()); } /* @@ -381,9 +382,9 @@ class UnrealIRCdProto : public IRCDProto } /* SVSMODE -b */ - void SendBanDel(Channel *c, const char *nick) + void SendBanDel(Channel *c, const std::string &nick) { - SendSVSModeChan(c, "-b", nick); + SendSVSModeChan(c, "-b", nick.empty() ? NULL : nick.c_str()); } @@ -958,7 +959,7 @@ int anope_event_userhost(const char *source, int ac, const char **av) std::string host = std::string(std::find(reply.begin(), reply.end(), '@'), reply.end()); host.erase(host.begin()); - User *u = finduser(user.c_str()); + User *u = finduser(user); if (u) { u->SetCloakedHost(host); |
