X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_spanningtree%2Fmain.cpp;h=ade8359ba4a85463ad714e1e7c40243544f553bc;hb=da29af8cba49d51e53d6e68237ccbf6370b6dd1f;hp=98cf3188fe677cfc8908a21948cb0af7a3ae4635;hpb=06bc8df45045a3d1fdc45f793abf7ba72b7403b1;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 98cf3188f..ade8359ba 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -37,7 +37,7 @@ ModuleSpanningTree::ModuleSpanningTree() : rconnect(this), rsquit(this), map(this) - , commands(NULL) + , commands(this) , currmembid(0) , eventprov(this, "event/spanningtree") , DNS(this, "DNS") @@ -89,7 +89,6 @@ void ModuleSpanningTree::init() Utils = new SpanningTreeUtilities(this); Utils->TreeRoot = new TreeServer; - commands = new SpanningTreeCommands(this); ServerInstance->PI = &protocolinterface; @@ -128,16 +127,15 @@ void ModuleSpanningTree::ShowLinks(TreeServer* Current, User* user, int hops) else if ((Current->Hidden) && (!user->IsOper())) return; - user->WriteNumeric(RPL_LINKS, "%s %s :%d %s", Current->GetName().c_str(), - (Utils->FlatLinks && (!user->IsOper())) ? ServerInstance->Config->ServerName.c_str() : Parent.c_str(), - (Utils->FlatLinks && (!user->IsOper())) ? 0 : hops, - Current->GetDesc().c_str()); + user->WriteNumeric(RPL_LINKS, Current->GetName(), + (((Utils->FlatLinks) && (!user->IsOper())) ? ServerInstance->Config->ServerName : Parent), + InspIRCd::Format("%d %s", (((Utils->FlatLinks) && (!user->IsOper())) ? 0 : hops), Current->GetDesc().c_str())); } void ModuleSpanningTree::HandleLinks(const std::vector& parameters, User* user) { ShowLinks(Utils->TreeRoot,user,0); - user->WriteNumeric(RPL_ENDOFLINKS, "* :End of /LINKS list."); + user->WriteNumeric(RPL_ENDOFLINKS, '*', "End of /LINKS list."); } std::string ModuleSpanningTree::TimeToStr(time_t secs) @@ -305,11 +303,11 @@ ModResult ModuleSpanningTree::HandleVersion(const std::vector& para // or the server is a 2.0 server and does not send a full version. bool showfull = ((user->IsOper()) && (!found->GetFullVersion().empty())); const std::string& Version = (showfull ? found->GetFullVersion() : found->GetVersion()); - user->WriteNumeric(RPL_VERSION, ":%s", Version.c_str()); + user->WriteNumeric(RPL_VERSION, Version); } else { - user->WriteNumeric(ERR_NOSUCHSERVER, "%s :No such server", parameters[0].c_str()); + user->WriteNumeric(ERR_NOSUCHSERVER, parameters[0], "No such server"); } return MOD_RES_DENY; } @@ -358,7 +356,7 @@ ModResult ModuleSpanningTree::HandleConnect(const std::vector& para return MOD_RES_DENY; } -void ModuleSpanningTree::OnUserInvite(User* source,User* dest,Channel* channel, time_t expiry) +void ModuleSpanningTree::OnUserInvite(User* source, User* dest, Channel* channel, time_t expiry, unsigned int notifyrank, CUList& notifyexcepts) { if (IS_LOCAL(source)) { @@ -736,7 +734,6 @@ ModuleSpanningTree::~ModuleSpanningTree() SetLocalUsersServer(newsrv); delete Utils; - delete commands; } Version ModuleSpanningTree::GetVersion()