*/
#include "inspircd.h"
-#include "users.h"
#include "cull_list.h"
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;
{
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;
this->oper_reason = r;
}
+void CullItem::MakeSilent()
+{
+ this->silent = true;
+}
+
+bool CullItem::IsSilent()
+{
+ return this->silent;
+}
+
CullItem::~CullItem()
{
}
}
}
+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();
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()));
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
- 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 ((!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();
}