summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2012-11-18 23:53:50 +0100
committerattilamolnar <attilamolnar@hush.com>2012-11-19 18:32:42 +0100
commit6c67546af64cec887bb716f666016eb93fde5d2b (patch)
treef5fd16a2d04a0450769c489fb7ccbf91cb7db803 /src/modules
parent7eab4fd473143be2516037b114d48b89cc481fc4 (diff)
ServerConfig::ServerName is a std::string, don't call .c_str() on it when passing it to Channel::WriteChannelWithServ, etc.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_alltime.cpp2
-rw-r--r--src/modules/m_chanlog.cpp4
-rw-r--r--src/modules/m_dnsbl.cpp6
-rw-r--r--src/modules/m_ojoin.cpp2
-rw-r--r--src/modules/m_override.cpp8
-rw-r--r--src/modules/m_remove.cpp2
6 files changed, 12 insertions, 12 deletions
diff --git a/src/modules/m_alltime.cpp b/src/modules/m_alltime.cpp
index 29a0ee42c..76536ed3f 100644
--- a/src/modules/m_alltime.cpp
+++ b/src/modules/m_alltime.cpp
@@ -38,7 +38,7 @@ class CommandAlltime : public Command
time_t now = ServerInstance->Time();
strftime(fmtdate, sizeof(fmtdate), "%Y-%m-%d %H:%M:%S", gmtime(&now));
- std::string msg = ":" + std::string(ServerInstance->Config->ServerName.c_str()) + " NOTICE " + user->nick + " :System time is " + fmtdate + " (" + ConvToStr(ServerInstance->Time()) + ") on " + ServerInstance->Config->ServerName;
+ std::string msg = ":" + ServerInstance->Config->ServerName + " NOTICE " + user->nick + " :System time is " + fmtdate + " (" + ConvToStr(ServerInstance->Time()) + ") on " + ServerInstance->Config->ServerName;
user->SendText(msg);
diff --git a/src/modules/m_chanlog.cpp b/src/modules/m_chanlog.cpp
index d7d074b3a..f2c2f6c6f 100644
--- a/src/modules/m_chanlog.cpp
+++ b/src/modules/m_chanlog.cpp
@@ -85,7 +85,7 @@ class ModuleChanLog : public Module
Channel *c = ServerInstance->FindChan(it->second);
if (c)
{
- c->WriteChannelWithServ(ServerInstance->Config->ServerName.c_str(), "PRIVMSG %s :%s", c->name.c_str(), buf);
+ c->WriteChannelWithServ(ServerInstance->Config->ServerName, "PRIVMSG %s :%s", c->name.c_str(), buf);
ServerInstance->PI->SendChannelPrivmsg(c, 0, buf);
}
}
@@ -147,7 +147,7 @@ class ChannelLogStream : public LogStream
char buf[MAXBUF];
snprintf(buf, MAXBUF, "\2%s\2: %s", type.c_str(), msg.c_str());
- c->WriteChannelWithServ(ServerInstance->Config->ServerName.c_str(), "PRIVMSG %s :%s", c->name.c_str(), buf);
+ c->WriteChannelWithServ(ServerInstance->Config->ServerName, "PRIVMSG %s :%s", c->name.c_str(), buf);
ServerInstance->PI->SendChannelPrivmsg(c, 0, buf);
Logging = false;
}
diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp
index c6a9e1fb0..d7d013691 100644
--- a/src/modules/m_dnsbl.cpp
+++ b/src/modules/m_dnsbl.cpp
@@ -417,12 +417,12 @@ class ModuleDNSBL : public Module
total_hits += (*i)->stats_hits;
total_misses += (*i)->stats_misses;
- results.push_back(std::string(ServerInstance->Config->ServerName.c_str()) + " 304 " + user->nick + " :DNSBLSTATS DNSbl \"" + (*i)->name + "\" had " +
+ results.push_back(ServerInstance->Config->ServerName + " 304 " + user->nick + " :DNSBLSTATS DNSbl \"" + (*i)->name + "\" had " +
ConvToStr((*i)->stats_hits) + " hits and " + ConvToStr((*i)->stats_misses) + " misses");
}
- results.push_back(std::string(ServerInstance->Config->ServerName.c_str()) + " 304 " + user->nick + " :DNSBLSTATS Total hits: " + ConvToStr(total_hits));
- results.push_back(std::string(ServerInstance->Config->ServerName.c_str()) + " 304 " + user->nick + " :DNSBLSTATS Total misses: " + ConvToStr(total_misses));
+ results.push_back(ServerInstance->Config->ServerName + " 304 " + user->nick + " :DNSBLSTATS Total hits: " + ConvToStr(total_hits));
+ results.push_back(ServerInstance->Config->ServerName + " 304 " + user->nick + " :DNSBLSTATS Total misses: " + ConvToStr(total_misses));
return MOD_RES_PASSTHRU;
}
diff --git a/src/modules/m_ojoin.cpp b/src/modules/m_ojoin.cpp
index e16fe3588..706fff1e1 100644
--- a/src/modules/m_ojoin.cpp
+++ b/src/modules/m_ojoin.cpp
@@ -76,7 +76,7 @@ class CommandOjoin : public Command
if (notice)
{
channel = ServerInstance->FindChan(parameters[0]);
- channel->WriteChannelWithServ(ServerInstance->Config->ServerName.c_str(), "NOTICE %s :%s joined on official network business.",
+ channel->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :%s joined on official network business.",
parameters[0].c_str(), user->nick.c_str());
ServerInstance->PI->SendChannelNotice(channel, 0, user->nick + " joined on official network business.");
}
diff --git a/src/modules/m_override.cpp b/src/modules/m_override.cpp
index c7b365790..c7a6b8bfd 100644
--- a/src/modules/m_override.cpp
+++ b/src/modules/m_override.cpp
@@ -135,7 +135,7 @@ class ModuleOverride : public Module
}
if (NoisyOverride)
- chan->WriteChannelWithServ(ServerInstance->Config->ServerName.c_str(), "NOTICE %s :%s used oper override to bypass invite-only", cname, user->nick.c_str());
+ chan->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :%s used oper override to bypass invite-only", cname, user->nick.c_str());
ServerInstance->SNO->WriteGlobalSno('v', user->nick+" used oper override to bypass +i on "+std::string(cname));
}
return MOD_RES_ALLOW;
@@ -151,7 +151,7 @@ class ModuleOverride : public Module
}
if (NoisyOverride)
- chan->WriteChannelWithServ(ServerInstance->Config->ServerName.c_str(), "NOTICE %s :%s used oper override to bypass the channel key", cname, user->nick.c_str());
+ chan->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :%s used oper override to bypass the channel key", cname, user->nick.c_str());
ServerInstance->SNO->WriteGlobalSno('v', user->nick+" used oper override to bypass +k on "+std::string(cname));
return MOD_RES_ALLOW;
}
@@ -166,7 +166,7 @@ class ModuleOverride : public Module
}
if (NoisyOverride)
- chan->WriteChannelWithServ(ServerInstance->Config->ServerName.c_str(), "NOTICE %s :%s used oper override to bypass the channel limit", cname, user->nick.c_str());
+ chan->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :%s used oper override to bypass the channel limit", cname, user->nick.c_str());
ServerInstance->SNO->WriteGlobalSno('v', user->nick+" used oper override to bypass +l on "+std::string(cname));
return MOD_RES_ALLOW;
}
@@ -181,7 +181,7 @@ class ModuleOverride : public Module
}
if (NoisyOverride)
- chan->WriteChannelWithServ(ServerInstance->Config->ServerName.c_str(), "NOTICE %s :%s used oper override to bypass channel ban", cname, user->nick.c_str());
+ chan->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :%s used oper override to bypass channel ban", cname, user->nick.c_str());
ServerInstance->SNO->WriteGlobalSno('v',"%s used oper override to bypass channel ban on %s", user->nick.c_str(), cname);
return MOD_RES_ALLOW;
}
diff --git a/src/modules/m_remove.cpp b/src/modules/m_remove.cpp
index ae583315a..4d8b90875 100644
--- a/src/modules/m_remove.cpp
+++ b/src/modules/m_remove.cpp
@@ -120,7 +120,7 @@ class RemoveBase : public Command
/* Build up the part reason string. */
reason = "Removed by " + user->nick + ": " + reasonparam;
- channel->WriteChannelWithServ(ServerInstance->Config->ServerName.c_str(), "NOTICE %s :%s removed %s from the channel", channel->name.c_str(), user->nick.c_str(), target->nick.c_str());
+ channel->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :%s removed %s from the channel", channel->name.c_str(), user->nick.c_str(), target->nick.c_str());
target->WriteServ("NOTICE %s :*** %s removed you from %s with the message: %s", target->nick.c_str(), user->nick.c_str(), channel->name.c_str(), reasonparam.c_str());
channel->PartUser(target, reason);