2 * InspIRCd -- Internet Relay Chat Daemon
4 * Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
5 * Copyright (C) 2007-2009 Craig Edwards <craigedwards@brainbox.cc>
6 * Copyright (C) 2007-2008 Robin Burchell <robin+git@viroteck.net>
7 * Copyright (C) 2008 Thomas Stagner <aquanight@inspircd.org>
8 * Copyright (C) 2007 Dennis Friis <peavey@inspircd.org>
10 * This file is part of InspIRCd. InspIRCd is free software: you can
11 * redistribute it and/or modify it under the terms of the GNU General Public
12 * License as published by the Free Software Foundation, version 2.
14 * This program is distributed in the hope that it will be useful, but WITHOUT
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
29 #include "resolvers.h"
32 #include "treeserver.h"
34 #include "treesocket.h"
36 #include "translate.h"
38 ModuleSpanningTree::ModuleSpanningTree()
39 : Away::EventListener(this)
40 , Stats::EventListener(this)
41 , CTCTags::EventListener(this)
47 , broadcasteventprov(this, "event/server-broadcast")
48 , linkeventprov(this, "event/server-link")
49 , messageeventprov(this, "event/server-message")
50 , synceventprov(this, "event/server-sync")
53 , tagevprov(this, "event/messagetag")
58 SpanningTreeCommands::SpanningTreeCommands(ModuleSpanningTree* module)
59 : svsjoin(module), svspart(module), svsnick(module), metadata(module),
60 uid(module), opertype(module), fjoin(module), ijoin(module), resync(module),
61 fmode(module), ftopic(module), fhost(module), fident(module), fname(module),
62 away(module), addline(module), delline(module), encap(module), idle(module),
63 nick(module), ping(module), pong(module), save(module),
64 server(module), squit(module), snonotice(module),
65 endburst(module), sinfo(module), num(module)
71 void SetLocalUsersServer(Server* newserver)
73 // Does not change the server of quitting users because those are not in the list
75 ServerInstance->FakeClient->server = newserver;
76 const UserManager::LocalList& list = ServerInstance->Users.GetLocalUsers();
77 for (UserManager::LocalList::const_iterator i = list.begin(); i != list.end(); ++i)
78 (*i)->server = newserver;
81 void ResetMembershipIds()
83 // Set all membership ids to 0
84 const UserManager::LocalList& list = ServerInstance->Users.GetLocalUsers();
85 for (UserManager::LocalList::iterator i = list.begin(); i != list.end(); ++i)
88 for (User::ChanList::iterator j = user->chans.begin(); j != user->chans.end(); ++j)
94 void ModuleSpanningTree::init()
96 ServerInstance->SNO->EnableSnomask('l', "LINK");
100 Utils = new SpanningTreeUtilities(this);
101 Utils->TreeRoot = new TreeServer;
103 ServerInstance->PI = &protocolinterface;
105 delete ServerInstance->FakeClient->server;
106 SetLocalUsersServer(Utils->TreeRoot);
109 void ModuleSpanningTree::ShowLinks(TreeServer* Current, User* user, int hops)
111 std::string Parent = Utils->TreeRoot->GetName();
112 if (Current->GetParent())
114 Parent = Current->GetParent()->GetName();
117 const TreeServer::ChildServers& children = Current->GetChildren();
118 for (TreeServer::ChildServers::const_iterator i = children.begin(); i != children.end(); ++i)
120 TreeServer* server = *i;
121 if ((server->Hidden) || ((Utils->HideULines) && (server->IsULine())))
125 ShowLinks(server, user, hops+1);
130 ShowLinks(server, user, hops+1);
133 /* Don't display the line if its a uline, hide ulines is on, and the user isnt an oper */
134 if ((Utils->HideULines) && (Current->IsULine()) && (!user->IsOper()))
136 /* Or if the server is hidden and they're not an oper */
137 else if ((Current->Hidden) && (!user->IsOper()))
140 user->WriteNumeric(RPL_LINKS, Current->GetName(),
141 (((Utils->FlatLinks) && (!user->IsOper())) ? ServerInstance->Config->ServerName : Parent),
142 InspIRCd::Format("%d %s", (((Utils->FlatLinks) && (!user->IsOper())) ? 0 : hops), Current->GetDesc().c_str()));
145 void ModuleSpanningTree::HandleLinks(const CommandBase::Params& parameters, User* user)
147 ShowLinks(Utils->TreeRoot,user,0);
148 user->WriteNumeric(RPL_ENDOFLINKS, '*', "End of /LINKS list.");
151 void ModuleSpanningTree::ConnectServer(Autoconnect* a, bool on_timer)
155 for(unsigned int j=0; j < a->servers.size(); j++)
157 if (Utils->FindServer(a->servers[j]))
159 // found something in this block. Should the server fail,
160 // we want to start at the start of the list, not in the
161 // middle where we left off
166 if (on_timer && a->position >= 0)
168 if (!on_timer && a->position < 0)
172 while (a->position < (int)a->servers.size())
174 Link* x = Utils->FindLink(a->servers[a->position]);
177 ServerInstance->SNO->WriteToSnoMask('l', "AUTOCONNECT: Auto-connecting server \002%s\002", x->Name.c_str());
183 // Autoconnect chain has been fully iterated; start at the beginning on the
184 // next AutoConnectServers run
188 void ModuleSpanningTree::ConnectServer(Link* x, Autoconnect* y)
190 if (InspIRCd::Match(ServerInstance->Config->ServerName, x->Name, ascii_case_insensitive_map))
192 ServerInstance->SNO->WriteToSnoMask('l', "CONNECT: Not connecting to myself.");
196 irc::sockets::sockaddrs sa;
197 if (x->IPAddr.find('/') != std::string::npos)
199 if (!irc::sockets::isunix(x->IPAddr) || !irc::sockets::untosa(x->IPAddr, sa))
201 // We don't use the family() != AF_UNSPEC check below for UNIX sockets as
202 // that results in a DNS lookup.
203 ServerInstance->SNO->WriteToSnoMask('l', "CONNECT: Error connecting \002%s\002: %s is not a UNIX socket!",
204 x->Name.c_str(), x->IPAddr.c_str());
210 // If this fails then the IP sa will be AF_UNSPEC.
211 irc::sockets::aptosa(x->IPAddr, x->Port, sa);
214 /* Do we already have an IP? If so, no need to resolve it. */
215 if (sa.family() != AF_UNSPEC)
217 // Create a TreeServer object that will start connecting immediately in the background
218 TreeSocket* newsocket = new TreeSocket(x, y, sa);
219 if (newsocket->GetFd() > -1)
221 /* Handled automatically on success */
225 ServerInstance->SNO->WriteToSnoMask('l', "CONNECT: Error connecting \002%s\002: %s.",
226 x->Name.c_str(), newsocket->getError().c_str());
227 ServerInstance->GlobalCulls.AddItem(newsocket);
232 ServerInstance->SNO->WriteToSnoMask('l', "CONNECT: Error connecting \002%s\002: Hostname given and core_dns is not loaded, unable to resolve.", x->Name.c_str());
236 // Guess start_type from bindip aftype
237 DNS::QueryType start_type = DNS::QUERY_AAAA;
238 irc::sockets::sockaddrs bind;
239 if ((!x->Bind.empty()) && (irc::sockets::aptosa(x->Bind, 0, bind)))
241 if (bind.family() == AF_INET)
242 start_type = DNS::QUERY_A;
245 ServernameResolver* snr = new ServernameResolver(*DNS, x->IPAddr, x, start_type, y);
250 catch (DNS::Exception& e)
253 ServerInstance->SNO->WriteToSnoMask('l', "CONNECT: Error connecting \002%s\002: %s.",x->Name.c_str(), e.GetReason().c_str());
254 ConnectServer(y, false);
259 void ModuleSpanningTree::AutoConnectServers(time_t curtime)
261 for (std::vector<reference<Autoconnect> >::iterator i = Utils->AutoconnectBlocks.begin(); i < Utils->AutoconnectBlocks.end(); ++i)
264 if (curtime >= x->NextConnectTime)
266 x->NextConnectTime = curtime + x->Period;
267 ConnectServer(x, true);
272 void ModuleSpanningTree::DoConnectTimeout(time_t curtime)
274 SpanningTreeUtilities::TimeoutList::iterator i = Utils->timeoutlist.begin();
275 while (i != Utils->timeoutlist.end())
277 TreeSocket* s = i->first;
278 std::pair<std::string, unsigned int> p = i->second;
279 SpanningTreeUtilities::TimeoutList::iterator me = i;
281 if (s->GetLinkState() == DYING)
283 Utils->timeoutlist.erase(me);
286 else if (curtime > s->age + p.second)
288 ServerInstance->SNO->WriteToSnoMask('l',"CONNECT: Error connecting \002%s\002 (timeout of %u seconds)",p.first.c_str(),p.second);
289 Utils->timeoutlist.erase(me);
295 ModResult ModuleSpanningTree::HandleVersion(const CommandBase::Params& parameters, User* user)
297 // We've already confirmed that !parameters.empty(), so this is safe
298 TreeServer* found = Utils->FindServerMask(parameters[0]);
301 if (found == Utils->TreeRoot)
303 // Pass to default VERSION handler.
304 return MOD_RES_PASSTHRU;
307 // If an oper wants to see the version then show the full version string instead of the normal,
308 // but only if it is non-empty.
309 // If it's empty it might be that the server is still syncing (full version hasn't arrived yet)
310 // or the server is a 2.0 server and does not send a full version.
311 bool showfull = ((user->IsOper()) && (!found->GetFullVersion().empty()));
313 Numeric::Numeric numeric(RPL_VERSION);
314 irc::tokenstream tokens(showfull ? found->GetFullVersion() : found->GetVersion());
315 for (std::string token; tokens.GetTrailing(token); )
317 user->WriteNumeric(numeric);
321 user->WriteNumeric(ERR_NOSUCHSERVER, parameters[0], "No such server");
326 ModResult ModuleSpanningTree::HandleConnect(const CommandBase::Params& parameters, User* user)
328 for (std::vector<reference<Link> >::iterator i = Utils->LinkBlocks.begin(); i < Utils->LinkBlocks.end(); i++)
331 if (InspIRCd::Match(x->Name, parameters[0], ascii_case_insensitive_map))
333 if (InspIRCd::Match(ServerInstance->Config->ServerName, x->Name, ascii_case_insensitive_map))
335 user->WriteRemoteNotice(InspIRCd::Format("*** CONNECT: Server \002%s\002 is ME, not connecting.", x->Name.c_str()));
339 TreeServer* CheckDupe = Utils->FindServer(x->Name);
342 user->WriteRemoteNotice(InspIRCd::Format("*** CONNECT: Connecting to server: \002%s\002 (%s:%d)", x->Name.c_str(), (x->HiddenFromStats ? "<hidden>" : x->IPAddr.c_str()), x->Port));
348 user->WriteRemoteNotice(InspIRCd::Format("*** CONNECT: Server \002%s\002 already exists on the network and is connected via \002%s\002", x->Name.c_str(), CheckDupe->GetParent()->GetName().c_str()));
353 user->WriteRemoteNotice(InspIRCd::Format("*** CONNECT: No server matching \002%s\002 could be found in the config file.", parameters[0].c_str()));
357 void ModuleSpanningTree::OnUserInvite(User* source, User* dest, Channel* channel, time_t expiry, unsigned int notifyrank, CUList& notifyexcepts)
359 if (IS_LOCAL(source))
361 CmdBuilder params(source, "INVITE");
362 params.push(dest->uuid);
363 params.push(channel->name);
364 params.push_int(channel->age);
365 params.push(ConvToStr(expiry));
370 ModResult ModuleSpanningTree::OnPreTopicChange(User* user, Channel* chan, const std::string& topic)
372 // XXX: Deny topic changes if the current topic set time is the current time or is in the future because
373 // other servers will drop our FTOPIC. This restriction will be removed when the protocol is updated.
374 if ((chan->topicset >= ServerInstance->Time()) && (Utils->serverlist.size() > 1))
376 user->WriteNumeric(ERR_CHANOPRIVSNEEDED, chan->name, "Retry topic change later");
379 return MOD_RES_PASSTHRU;
382 void ModuleSpanningTree::OnPostTopicChange(User* user, Channel* chan, const std::string &topic)
384 // Drop remote events on the floor.
388 CommandFTopic::Builder(user, chan).Broadcast();
391 void ModuleSpanningTree::OnUserPostMessage(User* user, const MessageTarget& target, const MessageDetails& details)
396 const char* message_type = (details.type == MSG_PRIVMSG ? "PRIVMSG" : "NOTICE");
399 case MessageTarget::TYPE_USER:
401 User* d = target.Get<User>();
404 CmdBuilder params(user, message_type);
405 params.push_tags(details.tags_out);
406 params.push(d->uuid);
407 params.push_last(details.text);
412 case MessageTarget::TYPE_CHANNEL:
414 Utils->SendChannelMessage(user, target.Get<Channel>(), details.text, target.status, details.tags_out, details.exemptions, message_type);
417 case MessageTarget::TYPE_SERVER:
419 const std::string* serverglob = target.Get<std::string>();
420 CmdBuilder par(user, message_type);
421 par.push_tags(details.tags_out);
422 par.push(*serverglob);
423 par.push_last(details.text);
430 void ModuleSpanningTree::OnUserPostTagMessage(User* user, const MessageTarget& target, const CTCTags::TagMessageDetails& details)
437 case MessageTarget::TYPE_USER:
439 User* d = target.Get<User>();
442 CmdBuilder params(user, "TAGMSG");
443 params.push_tags(details.tags_out);
444 params.push(d->uuid);
449 case MessageTarget::TYPE_CHANNEL:
451 Utils->SendChannelMessage(user, target.Get<Channel>(), "", target.status, details.tags_out, details.exemptions, "TAGMSG");
454 case MessageTarget::TYPE_SERVER:
456 const std::string* serverglob = target.Get<std::string>();
457 CmdBuilder par(user, "TAGMSG");
458 par.push_tags(details.tags_out);
459 par.push(*serverglob);
466 void ModuleSpanningTree::OnBackgroundTimer(time_t curtime)
468 AutoConnectServers(curtime);
469 DoConnectTimeout(curtime);
472 void ModuleSpanningTree::OnUserConnect(LocalUser* user)
477 // Create the lazy ssl_cert metadata for this user if not already created.
479 sslapi->GetCertificate(user);
481 CommandUID::Builder(user).Broadcast();
484 CommandOpertype::Builder(user).Broadcast();
486 for(Extensible::ExtensibleStore::const_iterator i = user->GetExtList().begin(); i != user->GetExtList().end(); i++)
488 ExtensionItem* item = i->first;
489 std::string value = item->ToNetwork(user, i->second);
491 ServerInstance->PI->SendMetaData(user, item->name, value);
494 Utils->TreeRoot->UserCount++;
497 void ModuleSpanningTree::OnUserJoin(Membership* memb, bool sync, bool created_by_local, CUList& excepts)
499 // Only do this for local users
500 if (!IS_LOCAL(memb->user))
503 // Assign the current membership id to the new Membership and increase it
504 memb->id = currmembid++;
506 if (created_by_local)
508 CommandFJoin::Builder params(memb->chan);
515 CmdBuilder params(memb->user, "IJOIN");
516 params.push(memb->chan->name);
517 params.push_int(memb->id);
518 if (!memb->modes.empty())
520 params.push(ConvToStr(memb->chan->age));
521 params.push(memb->modes);
527 void ModuleSpanningTree::OnChangeHost(User* user, const std::string &newhost)
529 if (user->registered != REG_ALL || !IS_LOCAL(user))
532 CmdBuilder(user, "FHOST").push(newhost).Broadcast();
535 void ModuleSpanningTree::OnChangeRealName(User* user, const std::string& real)
537 if (user->registered != REG_ALL || !IS_LOCAL(user))
540 CmdBuilder(user, "FNAME").push_last(real).Broadcast();
543 void ModuleSpanningTree::OnChangeIdent(User* user, const std::string &ident)
545 if ((user->registered != REG_ALL) || (!IS_LOCAL(user)))
548 CmdBuilder(user, "FIDENT").push(ident).Broadcast();
551 void ModuleSpanningTree::OnUserPart(Membership* memb, std::string &partmessage, CUList& excepts)
553 if (IS_LOCAL(memb->user))
555 CmdBuilder params(memb->user, "PART");
556 params.push(memb->chan->name);
557 if (!partmessage.empty())
558 params.push_last(partmessage);
563 void ModuleSpanningTree::OnUserQuit(User* user, const std::string &reason, const std::string &oper_message)
567 if (oper_message != reason)
568 ServerInstance->PI->SendMetaData(user, "operquit", oper_message);
570 CmdBuilder(user, "QUIT").push_last(reason).Broadcast();
574 // Hide the message if one of the following is true:
575 // - User is being quit due to a netsplit and quietbursts is on
576 // - Server is a silent uline
577 TreeServer* server = TreeServer::Get(user);
578 bool hide = (((server->IsDead()) && (Utils->quiet_bursts)) || (server->IsSilentULine()));
581 ServerInstance->SNO->WriteToSnoMask('Q', "Client exiting on server %s: %s (%s) [%s]",
582 user->server->GetName().c_str(), user->GetFullRealHost().c_str(), user->GetIPString().c_str(), oper_message.c_str());
586 // Regardless, update the UserCount
587 TreeServer::Get(user)->UserCount--;
590 void ModuleSpanningTree::OnUserPostNick(User* user, const std::string &oldnick)
594 // The nick TS is updated by the core, we don't do it
595 CmdBuilder params(user, "NICK");
596 params.push(user->nick);
597 params.push(ConvToStr(user->age));
602 ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "WARNING: Changed nick of remote user %s from %s to %s TS %lu by ourselves!", user->uuid.c_str(), oldnick.c_str(), user->nick.c_str(), (unsigned long) user->age);
606 void ModuleSpanningTree::OnUserKick(User* source, Membership* memb, const std::string &reason, CUList& excepts)
608 if ((!IS_LOCAL(source)) && (source != ServerInstance->FakeClient))
611 CmdBuilder params(source, "KICK");
612 params.push(memb->chan->name);
613 params.push(memb->user->uuid);
614 // If a remote user is being kicked by us then send the membership id in the kick too
615 if (!IS_LOCAL(memb->user))
616 params.push_int(memb->id);
617 params.push_last(reason);
621 void ModuleSpanningTree::OnPreRehash(User* user, const std::string ¶meter)
623 ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "OnPreRehash called with param %s", parameter.c_str());
625 // Send out to other servers
626 if (!parameter.empty() && parameter[0] != '-')
628 CmdBuilder params(user ? user : ServerInstance->FakeClient, "REHASH");
629 params.push(parameter);
630 params.Forward(user ? TreeServer::Get(user)->GetRoute() : NULL);
634 void ModuleSpanningTree::ReadConfig(ConfigStatus& status)
636 // Did this rehash change the description of this server?
637 const std::string& newdesc = ServerInstance->Config->ServerDesc;
638 if (newdesc != Utils->TreeRoot->GetDesc())
640 // Broadcast a SINFO desc message to let the network know about the new description. This is the description
641 // string that is sent in the SERVER message initially and shown for example in WHOIS.
642 // We don't need to update the field itself in the Server object - the core does that.
643 CommandSInfo::Builder(Utils->TreeRoot, "desc", newdesc).Broadcast();
646 // Re-read config stuff
649 Utils->ReadConfiguration();
651 catch (ModuleException& e)
653 // Refresh the IP cache anyway, so servers read before the error will be allowed to connect
654 Utils->RefreshIPCache();
655 // Always warn local opers with snomask +l, also warn globally (snomask +L) if the rehash was issued by a remote user
656 std::string msg = "Error in configuration: ";
657 msg.append(e.GetReason());
658 ServerInstance->SNO->WriteToSnoMask('l', msg);
659 if (status.srcuser && !IS_LOCAL(status.srcuser))
660 ServerInstance->PI->SendSNONotice('L', msg);
664 void ModuleSpanningTree::OnLoadModule(Module* mod)
668 data.append(mod->ModuleSourceFile);
669 Version v = mod->GetVersion();
670 if (!v.link_data.empty())
673 data.append(v.link_data);
675 ServerInstance->PI->SendMetaData("modules", data);
678 void ModuleSpanningTree::OnUnloadModule(Module* mod)
682 ServerInstance->PI->SendMetaData("modules", "-" + mod->ModuleSourceFile);
686 // We are being unloaded, inform modules about all servers splitting which cannot be done later when the servers are actually disconnected
687 const server_hash& servers = Utils->serverlist;
688 for (server_hash::const_iterator i = servers.begin(); i != servers.end(); ++i)
690 TreeServer* server = i->second;
691 if (!server->IsRoot())
692 FOREACH_MOD_CUSTOM(GetLinkEventProvider(), ServerProtocol::LinkEventListener, OnServerSplit, (server));
697 // Some other module is being unloaded. If it provides an IOHook we use, we must close that server connection now.
700 // Close all connections which use an IO hook provided by this module
701 const TreeServer::ChildServers& list = Utils->TreeRoot->GetChildren();
702 for (TreeServer::ChildServers::const_iterator i = list.begin(); i != list.end(); ++i)
704 TreeSocket* sock = (*i)->GetSocket();
705 if (sock->GetModHook(mod))
707 sock->SendError("SSL module unloaded");
709 // XXX: The list we're iterating is modified by TreeServer::SQuit() which is called by Close()
714 for (SpanningTreeUtilities::TimeoutList::const_iterator i = Utils->timeoutlist.begin(); i != Utils->timeoutlist.end(); ++i)
716 TreeSocket* sock = i->first;
717 if (sock->GetModHook(mod))
722 void ModuleSpanningTree::OnOper(User* user, const std::string &opertype)
724 if (user->registered != REG_ALL || !IS_LOCAL(user))
727 // Note: The protocol does not allow direct umode +o;
728 // sending OPERTYPE infers +o modechange locally.
729 CommandOpertype::Builder(user).Broadcast();
732 void ModuleSpanningTree::OnAddLine(User* user, XLine *x)
734 if (!x->IsBurstable() || loopCall || (user && !IS_LOCAL(user)))
738 user = ServerInstance->FakeClient;
740 CommandAddLine::Builder(x, user).Broadcast();
743 void ModuleSpanningTree::OnDelLine(User* user, XLine *x)
745 if (!x->IsBurstable() || loopCall || (user && !IS_LOCAL(user)))
749 user = ServerInstance->FakeClient;
751 CmdBuilder params(user, "DELLINE");
752 params.push(x->type);
753 params.push(x->Displayable());
757 void ModuleSpanningTree::OnUserAway(User* user)
760 CommandAway::Builder(user).Broadcast();
763 void ModuleSpanningTree::OnUserBack(User* user)
766 CommandAway::Builder(user).Broadcast();
769 void ModuleSpanningTree::OnMode(User* source, User* u, Channel* c, const Modes::ChangeList& modes, ModeParser::ModeProcessFlag processflags)
771 if (processflags & ModeParser::MODE_LOCALONLY)
776 if (u->registered != REG_ALL)
779 CmdBuilder params(source, "MODE");
780 params.push(u->uuid);
781 params.push(ClientProtocol::Messages::Mode::ToModeLetters(modes));
782 params.push_raw(Translate::ModeChangeListToParams(modes.getlist()));
787 CmdBuilder params(source, "FMODE");
788 params.push(c->name);
789 params.push_int(c->age);
790 params.push(ClientProtocol::Messages::Mode::ToModeLetters(modes));
791 params.push_raw(Translate::ModeChangeListToParams(modes.getlist()));
796 CullResult ModuleSpanningTree::cull()
800 return this->Module::cull();
803 ModuleSpanningTree::~ModuleSpanningTree()
805 ServerInstance->PI = &ServerInstance->DefaultProtocolInterface;
807 Server* newsrv = new Server(ServerInstance->Config->ServerName, ServerInstance->Config->ServerDesc);
808 SetLocalUsersServer(newsrv);
813 Version ModuleSpanningTree::GetVersion()
815 return Version("Allows servers to be linked", VF_VENDOR);
818 /* It is IMPORTANT that m_spanningtree is the last module in the chain
819 * so that any activity it sees is FINAL, e.g. we arent going to send out
820 * a NICK message before m_cloaking has finished putting the +x on the user,
822 * Therefore, we set our priority to PRIORITY_LAST to make sure we end up at the END of
823 * the module call queue.
825 void ModuleSpanningTree::Prioritize()
827 ServerInstance->Modules->SetPriority(this, PRIORITY_LAST);
828 ServerInstance->Modules.SetPriority(this, I_OnPreTopicChange, PRIORITY_FIRST);
831 MODULE_INIT(ModuleSpanningTree)