1
0
mirror of https://github.com/anope/anope.git synced 2026-06-26 02:46:38 +02:00

Store user away state and add it to the anope.user RPC event.

This commit is contained in:
Sadie Powell
2025-05-09 14:47:31 +01:00
parent 459f3d07c9
commit 977780d8ef
6 changed files with 57 additions and 15 deletions
+18
View File
@@ -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);