diff options
author | Sadie Powell <sadie@witchery.services> | 2025-05-09 14:47:31 +0100 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2025-05-09 14:47:31 +0100 |
commit | 977780d8ef8cc2d28690d66eff4292b7d9bbd1a7 (patch) | |
tree | 279cb3f48cc68d32406452759c1ab529d292d27d /modules/protocol/inspircd.cpp | |
parent | 459f3d07c999a0d55555d10139758e586d891f64 (diff) |
Store user away state and add it to the anope.user RPC event.
Diffstat (limited to 'modules/protocol/inspircd.cpp')
-rw-r--r-- | modules/protocol/inspircd.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/modules/protocol/inspircd.cpp b/modules/protocol/inspircd.cpp index 9535778ae..8ea6b7f7a 100644 --- a/modules/protocol/inspircd.cpp +++ b/modules/protocol/inspircd.cpp @@ -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> ¶ms, 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(); } }; |