diff options
| author | 2019-07-27 19:12:29 +0100 | |
|---|---|---|
| committer | 2019-07-27 19:12:29 +0100 | |
| commit | ada6646b6546e936f5f9d91f63f9f9fc6f651ef5 (patch) | |
| tree | 817e2f69b601d4bbf0ef720a69240050c915560d /src/modules/m_spanningtree/main.cpp | |
| parent | Remove code relating to v3 API changes and v2 module compatibility. (diff) | |
| parent | Improve the "max connections exceeded" oper snotice. (diff) | |
Merge branch 'insp3' into master.
Diffstat (limited to 'src/modules/m_spanningtree/main.cpp')
| -rw-r--r-- | src/modules/m_spanningtree/main.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 6177d7859..aaaee47d4 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -25,7 +25,6 @@ #include "socket.h" #include "xline.h" #include "iohook.h" -#include "modules/server.h" #include "resolvers.h" #include "main.h" @@ -47,6 +46,7 @@ ModuleSpanningTree::ModuleSpanningTree() , currmembid(0) , broadcasteventprov(this, "event/server-broadcast") , linkeventprov(this, "event/server-link") + , messageeventprov(this, "event/server-message") , synceventprov(this, "event/server-sync") , sslapi(this) , DNS(this, "DNS") @@ -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); } @@ -411,7 +411,7 @@ void ModuleSpanningTree::OnUserPostMessage(User* user, const MessageTarget& targ } case MessageTarget::TYPE_CHANNEL: { - Utils->SendChannelMessage(user->uuid, target.Get<Channel>(), details.text, target.status, details.tags_out, details.exemptions, message_type); + Utils->SendChannelMessage(user, target.Get<Channel>(), details.text, target.status, details.tags_out, details.exemptions, message_type); break; } case MessageTarget::TYPE_SERVER: @@ -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,14 +441,14 @@ 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; } case MessageTarget::TYPE_CHANNEL: { - Utils->SendChannelMessage(user->uuid, target.Get<Channel>(), "", target.status, details.tags_out, details.exemptions, "TAGMSG"); + Utils->SendChannelMessage(user, target.Get<Channel>(), "", target.status, details.tags_out, details.exemptions, "TAGMSG"); break; } case MessageTarget::TYPE_SERVER: @@ -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); @@ -625,8 +625,8 @@ void ModuleSpanningTree::OnPreRehash(User* user, const std::string ¶meter) // Send out to other servers if (!parameter.empty() && parameter[0] != '-') { - CmdBuilder params((user ? user->uuid : ServerInstance->Config->GetSID()), "REHASH"); - params.push_back(parameter); + CmdBuilder params(user ? user : ServerInstance->FakeClient, "REHASH"); + 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(); } |
