summaryrefslogtreecommitdiff
path: root/src/users.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/users.cpp')
-rw-r--r--src/users.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/users.cpp b/src/users.cpp
index 63a524488..5887bba2f 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -543,6 +543,24 @@ void User::UpdateHost()
}
}
+void User::SetAway(const Anope::string &msg, time_t ts)
+{
+ FOREACH_MOD(OnUserAway, (this, msg));
+ if (msg.empty())
+ {
+ this->awaymsg.clear();
+ this->awaytime = 0;
+ Log(this, "away") << "is no longer away";
+ }
+ else
+ {
+ this->awaymsg = msg;
+ this->awaytime = ts ? ts : Anope::CurTime;
+ Log(this, "away") << "is now away: " << msg;
+ }
+}
+
+
bool User::HasMode(const Anope::string &mname) const
{
return this->modes.count(mname);