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