void DisplayExpiry()
{
- ServerInstance->SNO->WriteToSnoMask('x',"Expiring timed shun %s (set by %s %ld seconds ago)", this->matchtext.c_str(), this->source, this->duration);
+ ServerInstance->SNO->WriteToSnoMask('x',"Removing expired shun %s (set by %s %ld seconds ago)", this->matchtext.c_str(), this->source, (long int)(ServerInstance->Time() - this->set_time));
}
const char* Displayable()
ShunFactory *f;
std::set<std::string> ShunEnabledCommands;
bool NotifyOfShun;
+ bool affectopers;
public:
ModuleShun(InspIRCd* Me) : Module(Me)
ShunEnabledCommands.clear();
NotifyOfShun = true;
+ affectopers = false;
std::stringstream dcmds(cmds);
std::string thiscmd;
}
NotifyOfShun = MyConf.ReadFlag("shun", "notifyuser", "yes", 0);
+ affectopers = MyConf.ReadFlag("shun", "affectopers", "no", 0);
}
virtual void OnUserConnect(User* user)
return 0;
}
+ if (!affectopers && IS_OPER(user))
+ {
+ /* Don't do anything if the user is an operator and affectopers isn't set */
+ return 0;
+ }
+
std::set<std::string>::iterator i = ShunEnabledCommands.find(command);
if (i == ShunEnabledCommands.end())
{
- user->WriteServ("NOTICE %s :*** Command %s not processed, as you have been blocked from issuing commands (SHUN)", user->nick.c_str(), command.c_str());
+ if (NotifyOfShun)
+ user->WriteServ("NOTICE %s :*** Command %s not processed, as you have been blocked from issuing commands (SHUN)", user->nick.c_str(), command.c_str());
return 1;
}