2 * InspIRCd -- Internet Relay Chat Daemon
4 * Copyright (C) 2017 Dylan Frank <b00mx0r@aureus.pw>
6 * This file is part of InspIRCd. InspIRCd is free software: you can
7 * redistribute it and/or modify it under the terms of the GNU General Public
8 * License as published by the Free Software Foundation, version 2.
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
26 class Shun : public XLine
30 * @param s_time The set time
31 * @param d The duration of the xline
32 * @param src The sender of the xline
33 * @param re The reason of the xline
34 * @param shunmask Mask to match
36 Shun(time_t s_time, long d, const std::string& src, const std::string& re, const std::string& shunmask)
37 : XLine(s_time, d, src, re, "SHUN")
42 bool Matches(User* u) CXX11_OVERRIDE
44 LocalUser* lu = IS_LOCAL(u);
48 if (InspIRCd::Match(u->GetFullHost(), matchtext) || InspIRCd::Match(u->GetFullRealHost(), matchtext) || InspIRCd::Match(u->nick+"!"+u->ident+"@"+u->GetIPString(), matchtext))
51 if (InspIRCd::MatchCIDR(u->GetIPString(), matchtext, ascii_case_insensitive_map))
57 bool Matches(const std::string& str) CXX11_OVERRIDE
59 return (matchtext == str);
62 const std::string& Displayable() CXX11_OVERRIDE
69 std::string matchtext;