1
0
mirror of https://github.com/anope/anope.git synced 2026-06-12 19:14:47 +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
+12 -7
View File
@@ -1056,17 +1056,22 @@ public:
};
struct IRCDMessageAway final
: Message::Away
: IRCDMessage
{
IRCDMessageAway(Module *creator) : Message::Away(creator, "AWAY") { SetFlag(FLAG_REQUIRE_USER); }
IRCDMessageAway(Module *creator)
: IRCDMessage(creator, "AWAY")
{
SetFlag(FLAG_REQUIRE_USER);
SetFlag(FLAG_SOFT_LIMIT);
}
void Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags) override
{
std::vector<Anope::string> newparams(params);
if (newparams.size() > 1)
newparams.erase(newparams.begin());
Message::Away::Run(source, newparams, tags);
auto *u = source.GetUser();
if (params.size() == 2)
u->SetAway(params[1], IRCD->ExtractTimestamp(params[0]));
else
u->SetAway();
}
};