summaryrefslogtreecommitdiff
path: root/src/users.cpp
diff options
context:
space:
mode:
authorAdam <Adam@drink-coca-cola.info>2010-05-28 18:27:22 -0400
committerAdam <Adam@anope.org>2010-06-18 21:04:08 -0400
commit435c9116e9997634eb7215e998c8f01a5e46fb2c (patch)
tree408ebfea2bef0fc8595f5d873c70549314fb40d8 /src/users.cpp
parentc43666e344250e4d559d116a73a9d4a313cf1645 (diff)
Added an arg to User::IsRecognized to check for NI_SECURE
Diffstat (limited to 'src/users.cpp')
-rw-r--r--src/users.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/users.cpp b/src/users.cpp
index 3e367ef47..b01862479 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -192,7 +192,7 @@ void User::SetRealname(const std::string &srealname)
this->realname = sstrdup(srealname.c_str());
NickAlias *na = findnick(this->nick);
- if (na && (this->IsIdentified(true) || (!na->nc->HasFlag(NI_SECURE) && this->IsRecognized())))
+ if (na && (this->IsIdentified(true) || this->IsRecognized(true)))
{
if (na->last_realname)
delete [] na->last_realname;
@@ -477,10 +477,21 @@ const bool User::IsIdentified(bool CheckNick) const
}
/** Check if the user is recognized for their nick (on the nicks access list)
+ * @param CheckSecure Only returns true if the user has secure off
* @return true or false
*/
-const bool User::IsRecognized() const
+const bool User::IsRecognized(bool CheckSecure) const
{
+ if (CheckSecure && OnAccess)
+ {
+ NickAlias *na = findnick(this->nick);
+
+ if (!na || !na->nc->HasFlag(NI_SECURE))
+ {
+ return false;
+ }
+ }
+
return OnAccess;
}
@@ -497,7 +508,7 @@ void User::UpdateHost()
if (na)
OnAccess = is_on_access(this, na->nc);
- if (na && (this->IsIdentified(true) || (!na->nc->HasFlag(NI_SECURE) && this->IsRecognized())))
+ if (na && (this->IsIdentified(true) || this->IsRecognized(true)))
{
if (na->last_usermask)
delete [] na->last_usermask;