summaryrefslogtreecommitdiff
path: root/src/protocol
diff options
context:
space:
mode:
authorcyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864>2010-01-02 04:55:43 +0000
committercyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864>2010-01-02 04:55:43 +0000
commit3617d7978899f830d952d9bac70ed14bb0cc0fd6 (patch)
treefa5fe5d8f8f3bd87f649e2467f60e1d87ba2a71c /src/protocol
parent657e1deb590eaba38ea3e9a9fb353dc0e23c1a41 (diff)
Convert 'const char *' and 'char *' function arguments to 'const std::string &' instead, done in actions.c along with chain reactions in other files.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2723 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/protocol')
-rw-r--r--src/protocol/bahamut.c11
-rw-r--r--src/protocol/inspircd11.c9
-rw-r--r--src/protocol/inspircd12.cpp6
-rw-r--r--src/protocol/ratbox.c6
-rw-r--r--src/protocol/unreal32.c13
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);