-/* $ModDesc: Provides the /SHUN command, which stops a user from executing all except configured commands. */
-
-class Shun : public XLine
-{
-public:
- std::string matchtext;
-
- Shun(time_t s_time, long d, std::string src, std::string re, std::string shunmask)
- : XLine(s_time, d, src, re, "SHUN")
- {
- this->matchtext = shunmask;
- }
-
- ~Shun()
- {
- }
-
- bool Matches(User *u)
- {
- // E: overrides shun
- LocalUser* lu = IS_LOCAL(u);
- if (lu && lu->exempt)
- return false;
-
- if (InspIRCd::Match(u->GetFullHost(), matchtext) || InspIRCd::Match(u->GetFullRealHost(), matchtext) || InspIRCd::Match(u->nick+"!"+u->ident+"@"+u->GetIPString(), matchtext))
- return true;
-
- return false;
- }
-
- bool Matches(const std::string &s)
- {
- if (matchtext == s)
- return true;
- return false;
- }
-
- void DisplayExpiry()
- {
- ServerInstance->SNO->WriteToSnoMask('x',"Removing expired shun %s (set by %s %ld seconds ago)",
- this->matchtext.c_str(), this->source.c_str(), (long int)(ServerInstance->Time() - this->set_time));
- }
-
- const char* Displayable()
- {
- return matchtext.c_str();
- }
-};