From edd95854edea5082dd56c0bcd267d0f52b8a6f8a Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 4 May 2007 22:37:11 +0000 Subject: Add options:quietbursts, fixes bug #269, also adds support for quits in a cull list which do not generate a quit snotice git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6883 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/cull_list.cpp | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'src/cull_list.cpp') 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::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(); } -- cgit v1.2.3