X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_spanningtree%2Fmain.cpp;h=bd49a3075a369722d43617eef85267f6aa1eaa71;hb=e9e75e50bc25e67af22dd88b39b12217a553d5cb;hp=77ef6a0fdef5bfc40fcdfab8ee21845eed93a3e9;hpb=667c558c650e447050cdbcc4971c2877f82fe8cf;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 77ef6a0fd..bd49a3075 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -47,8 +47,8 @@ ModuleSpanningTree::ModuleSpanningTree() SpanningTreeCommands::SpanningTreeCommands(ModuleSpanningTree* module) : rconnect(module, module->Utils), rsquit(module, module->Utils), svsjoin(module), svspart(module), svsnick(module), metadata(module), - uid(module), opertype(module), fjoin(module), fmode(module), ftopic(module), - fhost(module), fident(module), fname(module) + uid(module), opertype(module), fjoin(module), ijoin(module), resync(module), + fmode(module), ftopic(module), fhost(module), fident(module), fname(module) { } @@ -63,6 +63,8 @@ void ModuleSpanningTree::init() ServerInstance->Modules->AddService(commands->uid); ServerInstance->Modules->AddService(commands->opertype); ServerInstance->Modules->AddService(commands->fjoin); + ServerInstance->Modules->AddService(commands->ijoin); + ServerInstance->Modules->AddService(commands->resync); ServerInstance->Modules->AddService(commands->fmode); ServerInstance->Modules->AddService(commands->ftopic); ServerInstance->Modules->AddService(commands->fhost); @@ -194,8 +196,7 @@ restart: // ... if we can find a proper route to them if (tsock) { - tsock->WriteLine(":" + ServerInstance->Config->GetSID() + " PING " + - ServerInstance->Config->GetSID() + " " + s->GetID()); + tsock->WriteLine(":" + ServerInstance->Config->GetSID() + " PING " + s->GetID()); s->LastPingMsec = ts; } } @@ -551,20 +552,29 @@ void ModuleSpanningTree::OnUserConnect(LocalUser* user) Utils->TreeRoot->UserCount++; } -void ModuleSpanningTree::OnUserJoin(Membership* memb, bool sync, bool created, CUList& excepts) +void ModuleSpanningTree::OnUserJoin(Membership* memb, bool sync, bool created_by_local, CUList& excepts) { // Only do this for local users if (IS_LOCAL(memb->user)) { parameterlist params; - // set up their permissions and the channel TS with FJOIN. - // All users are FJOINed now, because a module may specify - // new joining permissions for the user. 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+","+memb->user->uuid); - Utils->DoOneToMany(ServerInstance->Config->GetSID(),"FJOIN",params); + if (created_by_local) + { + params.push_back(ConvToStr(memb->chan->age)); + params.push_back(std::string("+") + memb->chan->ChanModes(true)); + params.push_back(memb->modes+","+memb->user->uuid); + Utils->DoOneToMany(ServerInstance->Config->GetSID(),"FJOIN",params); + } + else + { + if (!memb->modes.empty()) + { + params.push_back(ConvToStr(memb->chan->age)); + params.push_back(memb->modes); + } + Utils->DoOneToMany(memb->user->uuid, "IJOIN", params); + } } } @@ -888,7 +898,7 @@ void ModuleSpanningTree::ProtoSendMetaData(void* opaque, Extensible* target, con if (u) s->WriteLine(":"+ServerInstance->Config->GetSID()+" METADATA "+u->uuid+" "+extname+" :"+extdata); else if (c) - s->WriteLine(":"+ServerInstance->Config->GetSID()+" METADATA "+c->name+" "+extname+" :"+extdata); + s->WriteLine(":"+ServerInstance->Config->GetSID()+" METADATA "+c->name+" "+ConvToStr(c->age)+" "+extname+" :"+extdata); else if (!target) s->WriteLine(":"+ServerInstance->Config->GetSID()+" METADATA * "+extname+" :"+extdata); }