]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Get rid of CommandBuilder::push_back.
authorPeter Powell <petpow@saberuk.com>
Fri, 19 Jul 2019 12:01:59 +0000 (13:01 +0100)
committerPeter Powell <petpow@saberuk.com>
Fri, 19 Jul 2019 12:01:59 +0000 (13:01 +0100)
src/modules/m_spanningtree/commandbuilder.h
src/modules/m_spanningtree/idle.cpp
src/modules/m_spanningtree/main.cpp
src/modules/m_spanningtree/nickcollide.cpp
src/modules/m_spanningtree/ping.cpp
src/modules/m_spanningtree/postcommand.cpp
src/modules/m_spanningtree/protocolinterface.cpp

index ec9533f2e25e21231867f46d9eb45716fedfb2bb..4913120e0645b01cab976887d3e8a67924b85118 100644 (file)
@@ -151,8 +151,6 @@ class CmdBuilder
                return *this;
        }
 
-       void push_back(const std::string& s) { push(s); }
-
        const std::string& str() const { return content; }
        operator const std::string&() const { return str(); }
 
index 972707ca23ad4efb30f51892e5b6a77564842a23..904142999370b7d1011eb1a1ef940b4728b589b6 100644 (file)
@@ -60,9 +60,9 @@ CmdResult CommandIdle::HandleRemote(RemoteUser* issuer, Params& params)
                        idle = ((unsigned int) (ServerInstance->Time() - localtarget->idle_lastmsg));
 
                CmdBuilder reply(target, "IDLE");
-               reply.push_back(issuer->uuid);
-               reply.push_back(ConvToStr(target->signon));
-               reply.push_back(ConvToStr(idle));
+               reply.push(issuer->uuid);
+               reply.push(ConvToStr(target->signon));
+               reply.push(ConvToStr(idle));
                reply.Unicast(issuer);
        }
 
index 2651e1a4ac4fc9ac5bfb4572bcb18045e1496981..561eed2fb47caf7396dca88eaf9efec944e1b04b 100644 (file)
@@ -359,10 +359,10 @@ void ModuleSpanningTree::OnUserInvite(User* source, User* dest, Channel* channel
        if (IS_LOCAL(source))
        {
                CmdBuilder params(source, "INVITE");
-               params.push_back(dest->uuid);
-               params.push_back(channel->name);
+               params.push(dest->uuid);
+               params.push(channel->name);
                params.push_int(channel->age);
-               params.push_back(ConvToStr(expiry));
+               params.push(ConvToStr(expiry));
                params.Broadcast();
        }
 }
@@ -403,7 +403,7 @@ void ModuleSpanningTree::OnUserPostMessage(User* user, const MessageTarget& targ
                        {
                                CmdBuilder params(user, message_type);
                                params.push_tags(details.tags_out);
-                               params.push_back(d->uuid);
+                               params.push(d->uuid);
                                params.push_last(details.text);
                                params.Unicast(d);
                        }
@@ -419,7 +419,7 @@ void ModuleSpanningTree::OnUserPostMessage(User* user, const MessageTarget& targ
                        const std::string* serverglob = target.Get<std::string>();
                        CmdBuilder par(user, message_type);
                        par.push_tags(details.tags_out);
-                       par.push_back(*serverglob);
+                       par.push(*serverglob);
                        par.push_last(details.text);
                        par.Broadcast();
                        break;
@@ -441,7 +441,7 @@ void ModuleSpanningTree::OnUserPostTagMessage(User* user, const MessageTarget& t
                        {
                                CmdBuilder params(user, "TAGMSG");
                                params.push_tags(details.tags_out);
-                               params.push_back(d->uuid);
+                               params.push(d->uuid);
                                params.Unicast(d);
                        }
                        break;
@@ -456,7 +456,7 @@ void ModuleSpanningTree::OnUserPostTagMessage(User* user, const MessageTarget& t
                        const std::string* serverglob = target.Get<std::string>();
                        CmdBuilder par(user, "TAGMSG");
                        par.push_tags(details.tags_out);
-                       par.push_back(*serverglob);
+                       par.push(*serverglob);
                        par.Broadcast();
                        break;
                }
@@ -513,12 +513,12 @@ void ModuleSpanningTree::OnUserJoin(Membership* memb, bool sync, bool created_by
        else
        {
                CmdBuilder params(memb->user, "IJOIN");
-               params.push_back(memb->chan->name);
+               params.push(memb->chan->name);
                params.push_int(memb->id);
                if (!memb->modes.empty())
                {
-                       params.push_back(ConvToStr(memb->chan->age));
-                       params.push_back(memb->modes);
+                       params.push(ConvToStr(memb->chan->age));
+                       params.push(memb->modes);
                }
                params.Broadcast();
        }
@@ -553,7 +553,7 @@ void ModuleSpanningTree::OnUserPart(Membership* memb, std::string &partmessage,
        if (IS_LOCAL(memb->user))
        {
                CmdBuilder params(memb->user, "PART");
-               params.push_back(memb->chan->name);
+               params.push(memb->chan->name);
                if (!partmessage.empty())
                        params.push_last(partmessage);
                params.Broadcast();
@@ -593,8 +593,8 @@ void ModuleSpanningTree::OnUserPostNick(User* user, const std::string &oldnick)
        {
                // The nick TS is updated by the core, we don't do it
                CmdBuilder params(user, "NICK");
-               params.push_back(user->nick);
-               params.push_back(ConvToStr(user->age));
+               params.push(user->nick);
+               params.push(ConvToStr(user->age));
                params.Broadcast();
        }
        else if (!loopCall)
@@ -609,8 +609,8 @@ void ModuleSpanningTree::OnUserKick(User* source, Membership* memb, const std::s
                return;
 
        CmdBuilder params(source, "KICK");
-       params.push_back(memb->chan->name);
-       params.push_back(memb->user->uuid);
+       params.push(memb->chan->name);
+       params.push(memb->user->uuid);
        // If a remote user is being kicked by us then send the membership id in the kick too
        if (!IS_LOCAL(memb->user))
                params.push_int(memb->id);
@@ -626,7 +626,7 @@ void ModuleSpanningTree::OnPreRehash(User* user, const std::string &parameter)
        if (!parameter.empty() && parameter[0] != '-')
        {
                CmdBuilder params(user ? user : ServerInstance->FakeClient, "REHASH");
-               params.push_back(parameter);
+               params.push(parameter);
                params.Forward(user ? TreeServer::Get(user)->GetRoute() : NULL);
        }
 }
@@ -749,8 +749,8 @@ void ModuleSpanningTree::OnDelLine(User* user, XLine *x)
                user = ServerInstance->FakeClient;
 
        CmdBuilder params(user, "DELLINE");
-       params.push_back(x->type);
-       params.push_back(x->Displayable());
+       params.push(x->type);
+       params.push(x->Displayable());
        params.Broadcast();
 }
 
index 62e200921eb8f92699346b31d4b4f16080d06a76..f1c6a9ae0dc5b9f346587aa0bd61e29f33760a69 100644 (file)
@@ -108,8 +108,8 @@ bool SpanningTreeUtilities::DoCollision(User* u, TreeServer* server, time_t remo
                 * this "local" nick is actually behind us, send a SAVE out.
                 */
                CmdBuilder params("SAVE");
-               params.push_back(u->uuid);
-               params.push_back(ConvToStr(u->age));
+               params.push(u->uuid);
+               params.push(ConvToStr(u->age));
                params.Broadcast();
 
                u->ChangeNick(u->uuid, CommandSave::SavedTimestamp);
index 844feb35b45e6b024f5b5772faf0ceae69d08e1b..51e87874d202d952138da7ab438df1656291163e 100644 (file)
@@ -30,10 +30,10 @@ CmdResult CommandPing::Handle(User* user, Params& params)
        {
                // PING for us, reply with a PONG
                CmdBuilder reply("PONG");
-               reply.push_back(user->uuid);
+               reply.push(user->uuid);
                if (params.size() >= 2)
                        // If there is a second parameter, append it
-                       reply.push_back(params[1]);
+                       reply.push(params[1]);
 
                reply.Unicast(user);
        }
index fe54abde2c0d8a1a3fc5fb9e68b6461e7b5119b2..10cbbce82f92d8a34312549c34d530501cbdef52 100644 (file)
@@ -45,7 +45,7 @@ void SpanningTreeUtilities::RouteCommand(TreeServer* origin, CommandBase* thiscm
        if (routing.type == ROUTE_TYPE_OPT_BCAST)
        {
                params.push('*');
-               params.push_back(command);
+               params.push(command);
        }
        else if (routing.type == ROUTE_TYPE_UNICAST || routing.type == ROUTE_TYPE_OPT_UCAST)
        {
@@ -64,8 +64,8 @@ void SpanningTreeUtilities::RouteCommand(TreeServer* origin, CommandBase* thiscm
 
                if (encap)
                {
-                       params.push_back(sdest->GetID());
-                       params.push_back(command);
+                       params.push(sdest->GetID());
+                       params.push(command);
                }
        }
        else
@@ -83,7 +83,7 @@ void SpanningTreeUtilities::RouteCommand(TreeServer* origin, CommandBase* thiscm
 
        std::string output_text = CommandParser::TranslateUIDs(thiscmd->translation, parameters, true, thiscmd);
 
-       params.push_back(output_text);
+       params.push(output_text);
 
        if (routing.type == ROUTE_TYPE_MESSAGE)
        {
index 2af122010c783e644b2e199d2ad16833282ac444..9fe93a389d76fa9f2efca920c72be1192dfda20d 100644 (file)
@@ -118,7 +118,7 @@ void SpanningTreeProtocolInterface::SendMessage(Channel* target, char status, co
 void SpanningTreeProtocolInterface::SendMessage(User* target, const std::string& text, MessageType msgtype)
 {
        CmdBuilder p(msgtype == MSG_PRIVMSG ? "PRIVMSG" : "NOTICE");
-       p.push_back(target->uuid);
+       p.push(target->uuid);
        p.push_last(text);
        p.Unicast(target);
 }