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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user