summaryrefslogtreecommitdiff
path: root/include/users.h
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2025-05-09 14:47:31 +0100
committerSadie Powell <sadie@witchery.services>2025-05-09 14:47:31 +0100
commit977780d8ef8cc2d28690d66eff4292b7d9bbd1a7 (patch)
tree279cb3f48cc68d32406452759c1ab529d292d27d /include/users.h
parent459f3d07c999a0d55555d10139758e586d891f64 (diff)
Store user away state and add it to the anope.user RPC event.
Diffstat (limited to 'include/users.h')
-rw-r--r--include/users.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/users.h b/include/users.h
index 08fa339b2..168b8e4f4 100644
--- a/include/users.h
+++ b/include/users.h
@@ -79,6 +79,10 @@ public: // XXX: exposing a tiny bit too much
time_t timestamp;
/* Is the user as super admin? */
bool super_admin;
+ /* The away message of the user */
+ Anope::string awaymsg;
+ /* The time the user went away */
+ time_t awaytime = 0;
/* Channels the user is in */
typedef std::map<Channel *, ChanUserContainer *> ChanUserList;
@@ -252,6 +256,12 @@ public:
/** Update the last usermask stored for a user. */
void UpdateHost();
+ /** Update the away state for a user. */
+ void SetAway(const Anope::string &msg = "", time_t ts = 0);
+
+ /** Determines whether this user is away. */
+ auto IsAway() const { return awaymsg.empty(); }
+
/** Check if the user has a mode
* @param name Mode name
* @return true or false