summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2013-04-09 19:12:09 +0200
committerattilamolnar <attilamolnar@hush.com>2013-04-10 17:28:08 +0200
commitca0083cba90c8830f5018b73eb715665a8db9dd7 (patch)
tree20d335e4d7c2f886fbce00d494eead769d22c543 /include
parent0f8f3af9accd4b2d2f17cd25dbb898187cc24c98 (diff)
Replace IS_AWAY() and IS_OPER() macros with User::IsAway() and User::IsOper()
Diffstat (limited to 'include')
-rw-r--r--include/users.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/include/users.h b/include/users.h
index 2cebc749d..4d3013ae8 100644
--- a/include/users.h
+++ b/include/users.h
@@ -329,7 +329,7 @@ class CoreExport User : public Extensible
std::string awaymsg;
/** Time the user last went away.
- * This is ONLY RELIABLE if user IS_AWAY()!
+ * This is ONLY RELIABLE if user IsAway()!
*/
time_t awaytime;
@@ -411,6 +411,18 @@ class CoreExport User : public Extensible
*/
std::string ProcessNoticeMasks(const char *sm);
+ /** Returns whether this user is currently away or not. If true,
+ * further information can be found in User::awaymsg and User::awaytime
+ * @return True if the user is away, false otherwise
+ */
+ bool IsAway() const { return (!awaymsg.empty()); }
+
+ /** Returns whether this user is an oper or not. If true,
+ * oper information can be obtained from User::oper
+ * @return True if the user is an oper, false otherwise
+ */
+ bool IsOper() const { return (oper != NULL); }
+
/** Returns true if a notice mask is set
* @param sm A notice mask character to check
* @return True if the notice mask is set
@@ -908,10 +920,6 @@ inline FakeUser* IS_SERVER(User* u)
{
return u->usertype == USERTYPE_SERVER ? static_cast<FakeUser*>(u) : NULL;
}
-/** Is an oper */
-#define IS_OPER(x) (x->oper)
-/** Is away */
-#define IS_AWAY(x) (!x->awaymsg.empty())
/** Derived from Resolver, and performs user forward/reverse lookups.
*/