From 977780d8ef8cc2d28690d66eff4292b7d9bbd1a7 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 9 May 2025 14:47:31 +0100 Subject: Store user away state and add it to the anope.user RPC event. --- include/users.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') 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 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 -- cgit