summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2015-01-10 15:23:24 -0500
committerAdam <Adam@anope.org>2015-01-10 15:24:48 -0500
commit1f02278a1c307975548499fe2a6d6d79f8397d0c (patch)
tree8b13a1bfe0895ef4473a117fc4a05af60cff5267
parent32007f81cf0bb475f3621d7637666b06ffa482b9 (diff)
Log user away messages
-rw-r--r--data/example.conf2
-rw-r--r--src/messages.cpp8
2 files changed, 8 insertions, 2 deletions
diff --git a/data/example.conf b/data/example.conf
index c1fc5c20d..0db803f62 100644
--- a/data/example.conf
+++ b/data/example.conf
@@ -713,7 +713,7 @@ log
* create, destroy, join, part, kick, leave, mode
*
* Valid user options are:
- * connect, disconnect, quit, nick, ident, host, mode, maxusers, oper
+ * connect, disconnect, quit, nick, ident, host, mode, maxusers, oper, away
*
* Rawio and debug are simple yes/no answers, there are no types for them.
*
diff --git a/src/messages.cpp b/src/messages.cpp
index 7036acfc7..a771b2f1f 100644
--- a/src/messages.cpp
+++ b/src/messages.cpp
@@ -25,7 +25,13 @@ using namespace Message;
void Away::Run(MessageSource &source, const std::vector<Anope::string> &params)
{
- FOREACH_MOD(OnUserAway, (source.GetUser(), params.empty() ? "" : params[0]));
+ const Anope::string &msg = !params.empty() ? params[0] : "";
+
+ FOREACH_MOD(OnUserAway, (source.GetUser(), msg));
+ if (!msg.empty())
+ Log(source.GetUser(), "away") << "is now away: " << msg;
+ else
+ Log(source.GetUser(), "away") << "is no longer away";
}
void Capab::Run(MessageSource &source, const std::vector<Anope::string> &params)