diff options
Diffstat (limited to 'src/protocol')
-rw-r--r-- | src/protocol/bahamut.c | 10 | ||||
-rw-r--r-- | src/protocol/inspircd11.c | 11 | ||||
-rw-r--r-- | src/protocol/inspircd12.cpp | 10 | ||||
-rw-r--r-- | src/protocol/ratbox.c | 10 | ||||
-rw-r--r-- | src/protocol/unreal32.c | 14 |
5 files changed, 31 insertions, 24 deletions
diff --git a/src/protocol/bahamut.c b/src/protocol/bahamut.c index 5ac0fe006..ced288073 100644 --- a/src/protocol/bahamut.c +++ b/src/protocol/bahamut.c @@ -236,9 +236,11 @@ class BahamutIRCdProto : public IRCDProto } /* UNSQLINE */ - void SendSQLineDel(const char *user) + void SendSQLineDel(const std::string &user) { - send_cmd(NULL, "UNSQLINE %s", user); + if (user.empty()) + return; + send_cmd(NULL, "UNSQLINE %s", user.c_str()); } /* JOIN - SJOIN */ @@ -292,10 +294,10 @@ class BahamutIRCdProto : public IRCDProto else send_cmd(source->nick, "KICK %s %s", chan->name.c_str(), user->nick.c_str()); } - void SendClientIntroduction(const char *nick, const char *user, const char *host, const char *real, const char *modes, const char *uid) + void SendClientIntroduction(const std::string &nick, const std::string &user, const std::string &host, const std::string &real, const char *modes, const std::string &uid) { EnforceQlinedNick(nick, Config.s_BotServ); - send_cmd(NULL, "NICK %s 1 %ld %s %s %s %s 0 0 :%s", nick, static_cast<long>(time(NULL)), modes, user, host, Config.ServerName, real); + send_cmd(NULL, "NICK %s 1 %ld %s %s %s %s 0 0 :%s", nick.c_str(), static_cast<long>(time(NULL)), modes, user.c_str(), host.c_str(), Config.ServerName, real.c_str()); SendSQLine(nick, "Reserved for services"); } diff --git a/src/protocol/inspircd11.c b/src/protocol/inspircd11.c index 659d1aaa9..da6883f3c 100644 --- a/src/protocol/inspircd11.c +++ b/src/protocol/inspircd11.c @@ -222,9 +222,9 @@ class InspIRCdProto : public IRCDProto send_cmd(bi ? bi->nick : Config.ServerName, "MODE %s %s", u->nick.c_str(), buf); } - void SendClientIntroduction(const char *nick, const char *user, const char *host, const char *real, const char *modes, const char *uid) + void SendClientIntroduction(const std::string &nick, const std::string &user, const std::string &host, const std::string &real, const char *modes, const std::string &uid) { - send_cmd(Config.ServerName, "NICK %ld %s %s %s %s %s 0.0.0.0 :%s", static_cast<long>(time(NULL)), nick, host, host, user, modes, real); + send_cmd(Config.ServerName, "NICK %ld %s %s %s %s %s 0.0.0.0 :%s", static_cast<long>(time(NULL)), nick.c_str(), host.c_str(), host.c_str(), user.c_str(), modes, real.c_str()); send_cmd(nick, "OPERTYPE Service"); } @@ -253,10 +253,11 @@ class InspIRCdProto : public IRCDProto } /* UNSQLINE */ - void SendSQLineDel(const char *user) + void SendSQLineDel(const std::string &user) { - if (!user) return; - send_cmd(Config.s_OperServ, "QLINE %s", user); + if (user.empty()) + return; + send_cmd(Config.s_OperServ, "QLINE %s", user.c_str()); } /* SQLINE */ diff --git a/src/protocol/inspircd12.cpp b/src/protocol/inspircd12.cpp index b791ca71f..e94d3cd1b 100644 --- a/src/protocol/inspircd12.cpp +++ b/src/protocol/inspircd12.cpp @@ -228,9 +228,9 @@ class InspIRCdProto : public IRCDProto send_cmd(bi ? bi->uid : TS6SID, "MODE %s %s", u->GetUID().c_str(), buf); } - void SendClientIntroduction(const char *nick, const char *user, const char *host, const char *real, const char *modes, const char *uid) + void SendClientIntroduction(const std::string &nick, const std::string &user, const std::string &host, const std::string &real, const char *modes, const std::string &uid) { - send_cmd(TS6SID, "UID %s %ld %s %s %s %s 0.0.0.0 %ld %s :%s", uid, static_cast<long>(time(NULL)), nick, host, host, user, static_cast<long>(time(NULL)), modes, real); + send_cmd(TS6SID, "UID %s %ld %s %s %s %s 0.0.0.0 %ld %s :%s", uid.c_str(), static_cast<long>(time(NULL)), nick.c_str(), host.c_str(), host.c_str(), user.c_str(), static_cast<long>(time(NULL)), modes, real.c_str()); } void SendKickInternal(BotInfo *source, Channel *chan, User *user, const char *buf) @@ -259,9 +259,11 @@ class InspIRCdProto : public IRCDProto } /* UNSQLINE */ - void SendSQLineDel(const char *user) + void SendSQLineDel(const std::string &user) { - send_cmd(TS6SID, "DELLINE Q %s", user); + if (user.empty()) + return; + send_cmd(TS6SID, "DELLINE Q %s", user.c_str()); } /* SQLINE */ diff --git a/src/protocol/ratbox.c b/src/protocol/ratbox.c index a9e2c9027..299b9b658 100644 --- a/src/protocol/ratbox.c +++ b/src/protocol/ratbox.c @@ -198,9 +198,11 @@ class RatboxProto : public IRCDTS6Proto send_cmd(bi ? bi->uid : Config.s_OperServ, "UNKLINE * %s %s", ak->user, ak->host); } - void SendSQLineDel(const char *user) + void SendSQLineDel(const std::string &user) { - send_cmd(TS6SID, "UNRESV * %s", user); + if (user.empty()) + return; + send_cmd(TS6SID, "UNRESV * %s", user.c_str()); } void SendJoin(BotInfo *user, const char *channel, time_t chantime) @@ -240,10 +242,10 @@ class RatboxProto : public IRCDTS6Proto ratbox_cmd_svinfo(); } - void SendClientIntroduction(const char *nick, const char *user, const char *host, const char *real, const char *modes, const char *uid) + void SendClientIntroduction(const std::string &nick, const std::string &user, const std::string &host, const std::string &real, const char *modes, const std::string &uid) { EnforceQlinedNick(nick, NULL); - send_cmd(TS6SID, "UID %s 1 %ld %s %s %s 0 %s :%s", nick, static_cast<long>(time(NULL)), modes, user, host, uid, real); + send_cmd(TS6SID, "UID %s 1 %ld %s %s %s 0 %s :%s", nick.c_str(), static_cast<long>(time(NULL)), modes, user.c_str(), host.c_str(), uid.c_str(), real.c_str()); SendSQLine(nick, "Reserved for services"); } diff --git a/src/protocol/unreal32.c b/src/protocol/unreal32.c index 81229930c..00335bbbb 100644 --- a/src/protocol/unreal32.c +++ b/src/protocol/unreal32.c @@ -234,11 +234,10 @@ class UnrealIRCdProto : public IRCDProto send_cmd(bi ? bi->nick : Config.ServerName, "v %s %s", u->nick.c_str(), buf); } - void SendClientIntroduction(const char *nick, const char *user, const char *host, const char *real, const char *modes, const char *uid) + void SendClientIntroduction(const std::string &nick, const std::string &user, const std::string &host, const std::string &real, const char *modes, const std::string &uid) { EnforceQlinedNick(nick, Config.s_BotServ); - send_cmd(NULL, "& %s 1 %ld %s %s %s 0 %s %s%s :%s", nick, static_cast<long>(time(NULL)), user, host, Config.ServerName, modes, host, - myIrcd->nickip ? " *" : " ", real); + send_cmd(NULL, "& %s 1 %ld %s %s %s 0 %s %s%s :%s", nick.c_str(), static_cast<long>(time(NULL)), user.c_str(), host.c_str(), Config.ServerName, modes, host.c_str(), myIrcd->nickip ? " *" : " ", real.c_str()); SendSQLine(nick, "Reserved for services"); } @@ -267,17 +266,18 @@ class UnrealIRCdProto : public IRCDProto /* JOIN */ void SendJoin(BotInfo *user, const char *channel, time_t chantime) { - send_cmd(Config.ServerName, "~ !%s %s :%s", base64enc(static_cast<long>(chantime)), channel, user->nick); + send_cmd(Config.ServerName, "~ !%s %s :%s", base64enc(static_cast<long>(chantime)), channel, user->nick.c_str()); } /* unsqline ** parv[0] = sender ** parv[1] = nickmask */ - void SendSQLineDel(const char *user) + void SendSQLineDel(const std::string &user) { - if (!user) return; - send_cmd(NULL, "d %s", user); + if (user.empty()) + return; + send_cmd(NULL, "d %s", user.c_str()); } |