summaryrefslogtreecommitdiff
path: root/src/users.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-11-20 21:45:30 -0500
committerAdam <Adam@anope.org>2010-12-12 19:35:27 -0500
commit246f44b9888161aecefc81f0ff17ddd893287e3c (patch)
treeb89607a9ad9c91914f292fc54cc32213a8d9f5c4 /src/users.cpp
parenta85112172d842aa74aa5531788d383328d153e74 (diff)
Added cs_mode, rewrote the old list mode code, and added CIDR support
Diffstat (limited to 'src/users.cpp')
-rw-r--r--src/users.cpp25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/users.cpp b/src/users.cpp
index 27426819b..ac16c61ac 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -165,6 +165,11 @@ Anope::string User::GetMask() const
return this->nick + "!" + this->ident + "@" + this->host;
}
+Anope::string User::GetDisplayedMask() const
+{
+ return this->nick + "!" + this->GetVIdent() + "@" + this->GetDisplayedHost();
+}
+
void User::SetRealname(const Anope::string &srealname)
{
if (srealname.empty())
@@ -921,7 +926,16 @@ bool is_excepted(ChannelInfo *ci, User *user)
if (!ci->c || !ModeManager::FindChannelModeByName(CMODE_EXCEPT))
return false;
- return elist_match_user(ci->c->excepts, user);
+
+ std::pair<Channel::ModeList::iterator, Channel::ModeList::iterator> modes = ci->c->GetModeList(CMODE_EXCEPT);
+ for (; modes.first != modes.second; ++modes.first)
+ {
+ Entry e(modes.first->second);
+ if (e.Matches(user))
+ return true;
+ }
+
+ return false;
}
/*************************************************************************/
@@ -932,7 +946,14 @@ bool is_excepted_mask(ChannelInfo *ci, const Anope::string &mask)
if (!ci->c || !ModeManager::FindChannelModeByName(CMODE_EXCEPT))
return false;
- return elist_match_mask(ci->c->excepts, mask, 0);
+ std::pair<Channel::ModeList::iterator, Channel::ModeList::iterator> modes = ci->c->GetModeList(CMODE_EXCEPT);
+ for (; modes.first != modes.second; ++modes.first)
+ {
+ if (Anope::Match(modes.first->second, mask))
+ return true;
+ }
+
+ return false;
}
/*************************************************************************/