diff options
author | attilamolnar <attilamolnar@hush.com> | 2012-07-24 14:54:29 +0200 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2012-10-12 03:57:39 +0200 |
commit | c8b41aa5d256d99eee67ec94492a94dc30e0ea35 (patch) | |
tree | 251cb805f1fe25423ca245b4a9b6d5db67451fe8 /src/modules/m_spanningtree | |
parent | 5961493368ec3c83b688afe6229d4efb1bb4d57a (diff) |
Remove superfluous std::string()s
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r-- | src/modules/m_spanningtree/capab.cpp | 4 | ||||
-rw-r--r-- | src/modules/m_spanningtree/main.cpp | 22 | ||||
-rw-r--r-- | src/modules/m_spanningtree/nickcollide.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree/override_squit.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree/ping.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree/rsquit.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree/server.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree/treesocket2.cpp | 4 |
8 files changed, 20 insertions, 20 deletions
diff --git a/src/modules/m_spanningtree/capab.cpp b/src/modules/m_spanningtree/capab.cpp index 40769df3d..62afe5974 100644 --- a/src/modules/m_spanningtree/capab.cpp +++ b/src/modules/m_spanningtree/capab.cpp @@ -321,7 +321,7 @@ bool TreeSocket::Capab(const parameterlist ¶ms) if (!this->GetTheirChallenge().empty() && (this->LinkState == CONNECTING)) { this->SendCapabilities(2); - this->WriteLine(std::string("SERVER ")+ServerInstance->Config->ServerName+" "+this->MakePass(capab->link->SendPass, capab->theirchallenge)+" 0 "+ServerInstance->Config->GetSID()+" :"+ServerInstance->Config->ServerDesc); + this->WriteLine("SERVER "+ServerInstance->Config->ServerName+" "+this->MakePass(capab->link->SendPass, capab->theirchallenge)+" 0 "+ServerInstance->Config->GetSID()+" :"+ServerInstance->Config->ServerDesc); } } else @@ -330,7 +330,7 @@ bool TreeSocket::Capab(const parameterlist ¶ms) if (this->LinkState == CONNECTING) { this->SendCapabilities(2); - this->WriteLine(std::string("SERVER ")+ServerInstance->Config->ServerName+" "+capab->link->SendPass+" 0 "+ServerInstance->Config->GetSID()+" :"+ServerInstance->Config->ServerDesc); + this->WriteLine("SERVER "+ServerInstance->Config->ServerName+" "+capab->link->SendPass+" 0 "+ServerInstance->Config->GetSID()+" :"+ServerInstance->Config->ServerDesc); } } diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 013bbce88..761343bb1 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -145,9 +145,9 @@ std::string ModuleSpanningTree::TimeToStr(time_t secs) secs = secs % 60; mins_up = mins_up % 60; hours_up = hours_up % 24; - return ((days_up ? (ConvToStr(days_up) + "d") : std::string("")) - + (hours_up ? (ConvToStr(hours_up) + "h") : std::string("")) - + (mins_up ? (ConvToStr(mins_up) + "m") : std::string("")) + return ((days_up ? (ConvToStr(days_up) + "d") : "") + + (hours_up ? (ConvToStr(hours_up) + "h") : "") + + (mins_up ? (ConvToStr(mins_up) + "m") : "") + ConvToStr(secs) + "s"); } @@ -194,7 +194,7 @@ restart: // ... if we can find a proper route to them if (tsock) { - tsock->WriteLine(std::string(":") + ServerInstance->Config->GetSID() + " PING " + + tsock->WriteLine(":" + ServerInstance->Config->GetSID() + " PING " + ServerInstance->Config->GetSID() + " " + s->GetID()); s->LastPingMsec = ts; } @@ -592,7 +592,7 @@ void ModuleSpanningTree::OnUserConnect(LocalUser* user) params.push_back(user->GetIPString()); params.push_back(ConvToStr(user->signon)); params.push_back("+"+std::string(user->FormatModes(true))); - params.push_back(":"+std::string(user->fullname)); + params.push_back(":"+user->fullname); Utils->DoOneToMany(ServerInstance->Config->GetSID(), "UID", params); if (IS_OPER(user)) @@ -625,7 +625,7 @@ void ModuleSpanningTree::OnUserJoin(Membership* memb, bool sync, bool created, C params.push_back(memb->chan->name); params.push_back(ConvToStr(memb->chan->age)); params.push_back(std::string("+") + memb->chan->ChanModes(true)); - params.push_back(memb->modes+","+std::string(memb->user->uuid)); + params.push_back(memb->modes+","+memb->user->uuid); Utils->DoOneToMany(ServerInstance->Config->GetSID(),"FJOIN",params); } } @@ -929,12 +929,12 @@ void ModuleSpanningTree::ProtoSendMode(void* opaque, TargetTypeFlags target_type if (target_type == TYPE_USER) { User* u = (User*)target; - s->WriteLine(std::string(":")+ServerInstance->Config->GetSID()+" MODE "+u->uuid+" "+output_text); + s->WriteLine(":"+ServerInstance->Config->GetSID()+" MODE "+u->uuid+" "+output_text); } else if (target_type == TYPE_CHANNEL) { Channel* c = (Channel*)target; - s->WriteLine(std::string(":")+ServerInstance->Config->GetSID()+" FMODE "+c->name+" "+ConvToStr(c->age)+" "+output_text); + s->WriteLine(":"+ServerInstance->Config->GetSID()+" FMODE "+c->name+" "+ConvToStr(c->age)+" "+output_text); } } } @@ -945,11 +945,11 @@ void ModuleSpanningTree::ProtoSendMetaData(void* opaque, Extensible* target, con User* u = dynamic_cast<User*>(target); Channel* c = dynamic_cast<Channel*>(target); if (u) - s->WriteLine(std::string(":")+ServerInstance->Config->GetSID()+" METADATA "+u->uuid+" "+extname+" :"+extdata); + s->WriteLine(":"+ServerInstance->Config->GetSID()+" METADATA "+u->uuid+" "+extname+" :"+extdata); else if (c) - s->WriteLine(std::string(":")+ServerInstance->Config->GetSID()+" METADATA "+c->name+" "+extname+" :"+extdata); + s->WriteLine(":"+ServerInstance->Config->GetSID()+" METADATA "+c->name+" "+extname+" :"+extdata); else if (!target) - s->WriteLine(std::string(":")+ServerInstance->Config->GetSID()+" METADATA * "+extname+" :"+extdata); + s->WriteLine(":"+ServerInstance->Config->GetSID()+" METADATA * "+extname+" :"+extdata); } CullResult ModuleSpanningTree::cull() diff --git a/src/modules/m_spanningtree/nickcollide.cpp b/src/modules/m_spanningtree/nickcollide.cpp index 5cb4344bf..38d59affb 100644 --- a/src/modules/m_spanningtree/nickcollide.cpp +++ b/src/modules/m_spanningtree/nickcollide.cpp @@ -127,7 +127,7 @@ int TreeSocket::DoCollision(User *u, time_t remotets, const std::string &remotei * the UID or halt the propagation of the nick change command, * so other servers don't need to see the SAVE */ - WriteLine(std::string(":")+ServerInstance->Config->GetSID()+" SAVE "+remoteuid+" "+ ConvToStr(remotets)); + WriteLine(":"+ServerInstance->Config->GetSID()+" SAVE "+remoteuid+" "+ ConvToStr(remotets)); if (remote) { diff --git a/src/modules/m_spanningtree/override_squit.cpp b/src/modules/m_spanningtree/override_squit.cpp index 2a95acb40..7d01c8149 100644 --- a/src/modules/m_spanningtree/override_squit.cpp +++ b/src/modules/m_spanningtree/override_squit.cpp @@ -46,7 +46,7 @@ ModResult ModuleSpanningTree::HandleSquit(const std::vector<std::string>& parame if (sock) { ServerInstance->SNO->WriteToSnoMask('l',"SQUIT: Server \002%s\002 removed from network by %s",parameters[0].c_str(),user->nick.c_str()); - sock->Squit(s,std::string("Server quit by ") + user->GetFullRealHost()); + sock->Squit(s,"Server quit by " + user->GetFullRealHost()); ServerInstance->SE->DelFd(sock); sock->Close(); } diff --git a/src/modules/m_spanningtree/ping.cpp b/src/modules/m_spanningtree/ping.cpp index 97cc44b6f..aec680b23 100644 --- a/src/modules/m_spanningtree/ping.cpp +++ b/src/modules/m_spanningtree/ping.cpp @@ -36,7 +36,7 @@ bool TreeSocket::LocalPing(const std::string &prefix, parameterlist ¶ms) if (params.size() == 1) { std::string stufftobounce = params[0]; - this->WriteLine(std::string(":")+ServerInstance->Config->GetSID()+" PONG "+stufftobounce); + this->WriteLine(":"+ServerInstance->Config->GetSID()+" PONG "+stufftobounce); return true; } else diff --git a/src/modules/m_spanningtree/rsquit.cpp b/src/modules/m_spanningtree/rsquit.cpp index e3ca22289..027ae02ab 100644 --- a/src/modules/m_spanningtree/rsquit.cpp +++ b/src/modules/m_spanningtree/rsquit.cpp @@ -63,7 +63,7 @@ CmdResult CommandRSQuit::Handle (const std::vector<std::string>& parameters, Use { const char *reason = parameters.size() == 2 ? parameters[1].c_str() : "No reason"; ServerInstance->SNO->WriteToSnoMask('l',"RSQUIT: Server \002%s\002 removed from network by %s (%s)", parameters[0].c_str(), user->nick.c_str(), reason); - sock->Squit(server_target, std::string("Server quit by ") + user->GetFullRealHost() + " (" + reason + ")"); + sock->Squit(server_target, "Server quit by " + user->GetFullRealHost() + " (" + reason + ")"); sock->Close(); } } diff --git a/src/modules/m_spanningtree/server.cpp b/src/modules/m_spanningtree/server.cpp index 64c32e8fb..33c7f47b3 100644 --- a/src/modules/m_spanningtree/server.cpp +++ b/src/modules/m_spanningtree/server.cpp @@ -254,7 +254,7 @@ bool TreeSocket::Inbound_Server(parameterlist ¶ms) // this is good. Send our details: Our server name and description and hopcount of 0, // along with the sendpass from this block. this->SendCapabilities(2); - this->WriteLine(std::string("SERVER ")+ServerInstance->Config->ServerName+" "+this->MakePass(x->SendPass, this->GetTheirChallenge())+" 0 "+ServerInstance->Config->GetSID()+" :"+ServerInstance->Config->ServerDesc); + this->WriteLine("SERVER "+ServerInstance->Config->ServerName+" "+this->MakePass(x->SendPass, this->GetTheirChallenge())+" 0 "+ServerInstance->Config->GetSID()+" :"+ServerInstance->Config->ServerDesc); // move to the next state, we are now waiting for THEM. MyRoot = new TreeServer(Utils, sname, description, sid, Utils->TreeRoot, this, x->Hidden); Utils->TreeRoot->AddChild(MyRoot); diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp index a06ff3a67..67908c414 100644 --- a/src/modules/m_spanningtree/treesocket2.cpp +++ b/src/modules/m_spanningtree/treesocket2.cpp @@ -129,7 +129,7 @@ void TreeSocket::ProcessLine(std::string &line) } else { - this->SendError(std::string("Invalid command in negotiation phase: ") + command.c_str()); + this->SendError("Invalid command in negotiation phase: " + command); } break; case WAIT_AUTH_2: @@ -394,7 +394,7 @@ void TreeSocket::ProcessConnectedLine(std::string& prefix, std::string& command, { if (params.size() != 2) { - SendError("Protocol violation: NICK message without TS - :"+std::string(who->uuid)+" NICK "+params[0]); + SendError("Protocol violation: NICK message without TS - :"+who->uuid+" NICK "+params[0]); return; } |