X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcull_list.cpp;h=ee257350ed523bd3efbde751c25f0af35bebc887;hb=46ff0bed0047c4cd05828c5f46dce63176e5084b;hp=f6ea2e0f1846fe925631b786e3f93ea04b294e52;hpb=821a5bca883ad8c06cb27963acf8861d9ef1031e;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/cull_list.cpp b/src/cull_list.cpp index f6ea2e0f1..ee257350e 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(); @@ -109,9 +134,9 @@ int CullList::Apply() if (a->GetUser()->registered == REG_ALL) { + FOREACH_MOD_I(ServerInstance,I_OnUserQuit,OnUserQuit(a->GetUser(), reason, oper_reason)); a->GetUser()->PurgeEmptyChannels(); a->GetUser()->WriteCommonQuit(reason, oper_reason); - FOREACH_MOD_I(ServerInstance,I_OnUserQuit,OnUserQuit(a->GetUser(), reason, oper_reason)); } FOREACH_MOD_I(ServerInstance,I_OnUserDisconnect,OnUserDisconnect(a->GetUser())); @@ -141,11 +166,18 @@ 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)) + if ((!ServerInstance->SilentULine(a->GetUser()->server)) && (!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(); }