-/* $ModDesc: Provides the /shun command, which stops a user executing all commands except PING and PONG. */
-
-class Shun : public XLine
-{
-public:
- std::string matchtext;
-
- Shun(InspIRCd* Instance, time_t s_time, long d, const char* src, const char* re, const char *shunmask) : XLine(Instance, s_time, d, src, re, "SHUN")
- {
- this->matchtext = shunmask;
- }
-
- ~Shun()
- {
- }
-
- bool Matches(User *u)
- {
- if (InspIRCd::Match(u->GetFullHost(), matchtext) || InspIRCd::Match(u->GetFullRealHost(), matchtext))
- return true;
-
- return false;
- }
-
- bool Matches(const std::string &s)
- {
- if (matchtext == s)
- return true;
- return false;
- }
-
- void Apply(User *u)
- {
- if (!u->GetExt("shunned"))
- u->Extend("shunned");
- }
-
-
- void DisplayExpiry()
- {
- ServerInstance->SNO->WriteToSnoMask('x',"Expiring timed shun %s (set by %s %ld seconds ago)", this->matchtext.c_str(), this->source, this->duration);
- }
-
- const char* Displayable()
- {
- return matchtext.c_str();
- }
-};