diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cull_list.cpp | 31 | ||||
-rw-r--r-- | src/modules/m_spanningtree/treeserver.cpp | 3 | ||||
-rw-r--r-- | src/modules/m_spanningtree/treesocket1.cpp | 6 | ||||
-rw-r--r-- | src/modules/m_spanningtree/utils.cpp | 1 | ||||
-rw-r--r-- | src/modules/m_spanningtree/utils.h | 3 |
5 files changed, 41 insertions, 3 deletions
diff --git a/src/cull_list.cpp b/src/cull_list.cpp index b0bf74ccb..ac842e248 100644 --- a/src/cull_list.cpp +++ b/src/cull_list.cpp @@ -19,6 +19,7 @@ CullItem::CullItem(userrec* u, std::string &r, const char* o_reason) { this->user = u; this->reason = r; + this->silent = false; /* Seperate oper reason not set, use the user reason */ if (*o_reason) this->oper_reason = o_reason; @@ -30,6 +31,7 @@ CullItem::CullItem(userrec* u, const char* r, const char* o_reason) { this->user = u; this->reason = r; + this->silent = false; /* Seperate oper reason not set, use the user reason */ if (*o_reason) this->oper_reason = o_reason; @@ -37,6 +39,16 @@ CullItem::CullItem(userrec* u, const char* r, const char* o_reason) this->oper_reason = r; } +void CullItem::MakeSilent() +{ + this->silent = true; +} + +bool CullItem::IsSilent() +{ + return this->silent; +} + CullItem::~CullItem() { } @@ -78,6 +90,19 @@ void CullList::AddItem(userrec* user, const char* reason, const char* o_reason) } } +void CullList::MakeSilent(userrec* user) +{ + for (std::vector<CullItem>::iterator a = list.begin(); a != list.end(); ++a) + { + if (a->GetUser() == user) + { + a->MakeSilent(); + break; + } + } + return; +} + int CullList::Apply() { int n = list.size(); @@ -141,11 +166,13 @@ int CullList::Apply() if (a->GetUser()->registered == REG_ALL) { if (IS_LOCAL(a->GetUser())) - ServerInstance->SNO->WriteToSnoMask('q',"Client exiting: %s!%s@%s [%s]",a->GetUser()->nick,a->GetUser()->ident,a->GetUser()->host,oper_reason.c_str()); + if (!a->IsSilent()) + ServerInstance->SNO->WriteToSnoMask('q',"Client exiting: %s!%s@%s [%s]",a->GetUser()->nick,a->GetUser()->ident,a->GetUser()->host,oper_reason.c_str()); else { if (!ServerInstance->SilentULine(a->GetUser()->server)) - ServerInstance->SNO->WriteToSnoMask('Q',"Client exiting on server %s: %s!%s@%s [%s]",a->GetUser()->server,a->GetUser()->nick,a->GetUser()->ident,a->GetUser()->host,oper_reason.c_str()); + if (!a->IsSilent()) + ServerInstance->SNO->WriteToSnoMask('Q',"Client exiting on server %s: %s!%s@%s [%s]",a->GetUser()->server,a->GetUser()->nick,a->GetUser()->ident,a->GetUser()->host,oper_reason.c_str()); } a->GetUser()->AddToWhoWas(); } diff --git a/src/modules/m_spanningtree/treeserver.cpp b/src/modules/m_spanningtree/treeserver.cpp index 2bcfecf2b..0c9509ada 100644 --- a/src/modules/m_spanningtree/treeserver.cpp +++ b/src/modules/m_spanningtree/treeserver.cpp @@ -144,6 +144,9 @@ int TreeServer::QuitUsers(const std::string &reason) userrec::QuitUser(ServerInstance, a, "*.net *.split", reason_s); else userrec::QuitUser(ServerInstance, a, reason_s); + + if (this->Utils->quiet_bursts) + ServerInstance->GlobalCulls.MakeSilent(a); } } return time_to_die.size(); diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp index 6176d0201..66d223fa6 100644 --- a/src/modules/m_spanningtree/treesocket1.cpp +++ b/src/modules/m_spanningtree/treesocket1.cpp @@ -1103,7 +1103,11 @@ bool TreeSocket::IntroduceClient(const std::string &source, std::deque<std::stri Instance->AddGlobalClone(_new); - if (!this->Instance->SilentULine(_new->server)) + bool send = (!this->Instance->SilentULine(_new->server)); + if (send) + send = (this->Utils->quiet_bursts && !this->bursting); + + if (send) this->Instance->SNO->WriteToSnoMask('C',"Client connecting at %s: %s!%s@%s [%s]",_new->server,_new->nick,_new->ident,_new->host, _new->GetIPString()); params[7] = ":" + params[7]; diff --git a/src/modules/m_spanningtree/utils.cpp b/src/modules/m_spanningtree/utils.cpp index 923308de0..e1026ca94 100644 --- a/src/modules/m_spanningtree/utils.cpp +++ b/src/modules/m_spanningtree/utils.cpp @@ -477,6 +477,7 @@ void SpanningTreeUtilities::ReadConfiguration(bool rebind) EnableTimeSync = Conf->ReadFlag("timesync","enable",0); MasterTime = Conf->ReadFlag("timesync", "master", 0); ChallengeResponse = !Conf->ReadFlag("options", "disablehmac", 0); + quiet_bursts = Conf->ReadFlag("options", "quietbursts", 0); LinkBlocks.clear(); ValidIPs.clear(); for (int j =0; j < Conf->Enumerate("link"); j++) diff --git a/src/modules/m_spanningtree/utils.h b/src/modules/m_spanningtree/utils.h index 2fd53bb43..0e289146b 100644 --- a/src/modules/m_spanningtree/utils.h +++ b/src/modules/m_spanningtree/utils.h @@ -63,6 +63,9 @@ class SpanningTreeUtilities /** Synchronize timestamps between servers */ bool EnableTimeSync; + /** Make snomasks +CQ quiet during bursts and splits + */ + bool quiet_bursts; /** Socket bindings for listening sockets */ std::vector<TreeSocket*> Bindings; |